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5vYXNpcy1vcGVuLm9yZy9kb2Nib29rL3htbC80LjEuMi9kb2Nib29reC5kdGQiIFtdPgorCis8Ym9vayBpZD0idzFpZCI+CisgIDxib29raW5mbz4KKyAgICA8dGl0bGU+VzE6IERhbGxhcycgMS13aXJlIGJ1czwvdGl0bGU+CisKKyAgICA8YXV0aG9yZ3JvdXA+CisgICAgICA8YXV0aG9yPgorICAgICAgICA8Zmlyc3RuYW1lPkRhdmlkPC9maXJzdG5hbWU+CisgICAgICAgIDxzdXJuYW1lPkZyaWVzPC9zdXJuYW1lPgorICAgICAgICA8YWZmaWxpYXRpb24+CisgICAgICAgICAgPGFkZHJlc3M+CisgICAgICAgICAgICA8ZW1haWw+RGF2aWRARnJpZXMubmV0PC9lbWFpbD4KKyAgICAgICAgICA8L2FkZHJlc3M+CisgICAgICAgIDwvYWZmaWxpYXRpb24+CisgICAgICA8L2F1dGhvcj4KKworICAgIDwvYXV0aG9yZ3JvdXA+CisKKyAgICA8Y29weXJpZ2h0PgorICAgICAgPHllYXI+MjAxMzwveWVhcj4KKyAgICAgIDwhLS0KKyAgICAgIDxob2xkZXI+PC9ob2xkZXI+CisgICAgICAtLT4KKyAgICA8L2NvcHlyaWdodD4KKworICAgIDxsZWdhbG5vdGljZT4KKyAgICAgIDxwYXJhPgorICAgICAgICBUaGlzIGRvY3VtZW50YXRpb24gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUKKyAgICAgICAgaXQgYW5kL29yIG1vZGlmeSBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYworICAgICAgICBMaWNlbnNlIHZlcnNpb24gMi4KKyAgICAgIDwvcGFyYT4KKworICAgICAgPHBhcmE+CisgICAgICAgIFRoaXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUKKyAgICAgICAgdXNlZnVsLCBidXQgV0lUSE9VV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gorCisgICAgPC9zZWN0MT4KKworCisgIDwvY2hhcHRlcj4KKworPC9ib29rPgpkaWZmIC0tZ2l0IGEvRG9jdW1lbnRhdGlvbi9Eb2NCb29rL3dyaXRpbmctYW4tYWxzYS1kcml2ZXIudG1wbCBiL0RvY3VtZW50YXRpb24vRG9jQm9vay93cml0aW5nLWFuLWFsc2EtZHJpdmVyLnRtcGwKaW5kZXggMDY3NDFlOS4uZDAwNTZhNCAxMDA2NDQKLS0tIGEvRG9jdW1lbnRhdGlvbi9Eb2NCb29rL3dyaXRpbmctYW4tYWxzYS1kcml2ZXIudG1wbAorKysgYi9Eb2N1bWVudGF0aW9uL0RvY0Jvb2svd3JpdGluZy1hbi1hbHNhLWRyaXZlci50bXBsCkBAIC00NjgsOCArNDY4LDYgQEAKICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CiAgICAgICAgICAgfQogCi0gICAgICAgICAgc25kX2NhcmRfc2V0X2RldihjYXJkLCAmcGNpLT5kZXYpOwotCiAgICAgICAgICAgKnJjaGlwID0gY2hpcDsKICAgICAgICAgICByZXR1cm4gMDsKICAgfQpAQCAtNDkyLDcgKzQ5MCw4IEBACiAgICAgICAgICAgfQogCiAgICAgICAgICAgLyogKDIpICovCi0gICAgICAgICAgZXJyID0gc25kX2NhcmRfY3JlYXRlKGluZGV4W2Rldl0sIGlkW2Rldl0sIFRISVNfTU9EVUxFLCAwLCAmY2FyZCk7CisgICAgICAgICAgZXJyID0gc25kX2NhcmRfbmV3KCZwY2ktPmRldiwgaW5kZXhbZGV2XSwgaWRbZGV2XSwgVEhJU19NT0RVTEUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICZjYXJkKTsKICAgICAgICAgICBpZiAoZXJyIDwgMCkKICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7CiAKQEAgLTU5MSw3ICs1OTAsOCBAQAogICBzdHJ1Y3Qgc25kX2NhcmQgKmNhcmQ7CiAgIGludCBlcnI7CiAgIC4uLi4KLSAg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93cyB0byBzcGVjaWZ5ICNhZGRyZXNzLWNlbGxzLCAjc2l6ZS1jZWxscyBwcm9wZXJ0aWVzIGZvciB0aGUgJ3BvcnQnCitub2RlcyBpbmRlcGVuZGVudGx5IGZyb20gYW55IG90aGVyIGNoaWxkIGRldmljZSBub2RlcyBhIGRldmljZSBtaWdodAoraGF2ZS4KKworZGV2aWNlIHsKKyAgICAgICAgLi4uCisgICAgICAgIHBvcnRzIHsKKyAgICAgICAgICAgICAgICAjYWRkcmVzcy1jZWxscyA9IDwxPjsKKyAgICAgICAgICAgICAgICAjc2l6ZS1jZWxscyA9IDwwPjsKKworICAgICAgICAgICAgICAgIHBvcnRAMCB7CisgICAgICAgICAgICAgICAgICAgICAgICAuLi4KKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZHBvaW50QDAgeyAuLi4gfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZHBvaW50QDEgeyAuLi4gfTsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgcG9ydEAxIHsgLi4uIH07CisgICAgICAgIH07Cit9OworCitMaW5rcyBiZXR3ZWVuIGVuZHBvaW50cworLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworRWFjaCBlbmRwb2ludCBzaG91bGQgY29udGFpbiBhICdyZW1vdGUtZW5kcG9pbnQnIHBoYW5kbGUgcHJvcGVydHkgdGhhdCBwb2ludHMKK3RvIHRoZSBjb3JyZXNwb25kaW5nIGVuZHBvaW50IGluIHRoZSBwb3J0IG9mIHRoZSByZW1vdGUgZGV2aWNlLiBJbiB0dXJuLCB0aGUKK3JlbW90ZSBlbmRwb2ludCBzaG91bGQgY29udGFpbiBhICdyZW1vdGUtZW5kcG9pbnQnIHByb3BlcnR5LiBJZiBpdCBoYXMgb25lLAoraXQgbXVzdCBub3QgcG9pbnQgdG8gYW5vdGhlciB0aGFuIHRoZSBsb2NhbCBlbmRwb2ludC4gVHdvIGVuZHBvaW50cyB3aXRoIHRoZWlyCisncmVtb3RlLWVuZHBvaW50JyBwaGFuZGxlcyBwb2ludGluZyBhdCBlYWNoIG90aGVyIGZvcm0gYSBsaW5rIGJldHdlZW4gdGhlCitjb250YWluaW5nIHBvcnRzLgorCitkZXZpY2UtMSB7CisgICAgICAgIHBvcnQgeworICAgICAgICAgICAgICAgIGRldmljZV8xX291dHB1dDogZW5kcG9pbnQgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3RlLWVuZHBvaW50ID0gPCZkZXZpY2VfMl9pbnB1dD47CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgfTsKK307CisKK2RldmljZS0yIHsKKyAgICAgICAgcG9ydCB7CisgICAgICAgICAgICAgICAgZGV2aWNlXzJfaW5wdXQ6IGVuZHBvaW50IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmZGV2aWNlXzFfb3V0cHV0PjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICB9OworfTsKKworCitSZXF1aXJlZCBwcm9wZXJ0aWVzCistLS0tLS0tLS0tLS0tLS0tLS0tCisKK0lmIHRoZXJlIGlzIG1vcmUgdGhhbiBvbmUgJ3BvcnQnIG9yIG1vcmUgdGhhbiBvbmUgJ2VuZHBvaW50JyBub2RlIG9yICdyZWcnCitwcm9wZXJ0eSBpcyBwcmVzZW50IGluIHBvcnQgYW5kL29yIGVuZHBvaW50IG5vZGVzIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllcworYXJlIHJlcXVpcmVkIGluIGEgcmVsZXZhbnQgcGFyZW50IG5vZGU6CisKKyAtICNhZGRyZXNzLWNlbGxzIDogbnVtYmVyIG9mIGNlbGxzIHJlcXVpcmVkIHRvIGRlZmluZSBwb3J0L2VuZHBvaW50CisgICAgICAgICAgICAgICAgICAgIGlkZW50aWZpZXIsIHNob3VsZCBiZSAxLgorIC0gI3NpemUtY2VsbHMgICAgOiBzaG91bGQgYmUgemVyby4KKworT3B0aW9uYWwgZW5kcG9pbnQgcHJ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ICAgICAgZS5nLiBVU0IyX1BIWSBvbiBPTUFQNS4KKyAidGksY29udHJvbC1waHktcGlwZTMiIC0gaWYgaXQgaGFzIERQTEwgYW5kIGluZGl2aWR1YWwgUnggJiBUeCBwb3dlciBjb250cm9sCisgICAgICAgICAgICAgICAgICAgICAgICBlLmcuIFVTQjMgUEhZIGFuZCBTQVRBIFBIWSBvbiBPTUFQNS4KKyAidGksY29udHJvbC1waHktdXNiMi1kcmE3IiAtIGlmIGl0IGhhcyBwb3dlciBkb3duIHJlZ2lzdGVyIGxpa2UgVVNCMiBQSFkgb24KKyAgICAgICAgICAgICAgICAgICAgICAgIERSQTcgcGxhdGZvcm0uCisgInRpLGNvbnRyb2wtcGh5LXVzYjItYW00MzciIC0gaWYgaXQgaGFzIHBvd2VyIGRvd24gcmVnaXN0ZXIgbGlrZSBVU0IyIFBIWSBvbgorICAgICAgICAgICAgICAgICAgICAgICAgQU00MzcgcGxhdGZvcm0uCisgLSByZWcgOiBBZGRyZXNzIGFuZCBsZW5ndGggb2YgdGhlIHJlZ2lzdGVyIHNldCBmb3IgdGhlIGRldmljZS4gSXQgY29udGFpbnMKKyAgIHRoZSBhZGRyZXNzIG9mICJvdGdoc19jb250cm9sIiBmb3IgY29udHJvbC1waHktb3RnaHMgb3IgInBvd2VyIiByZWdpc3RlcgorICAgZm9yIG90aGVyIHR5cGVzLgorIC0gcmVnLW5hbWVzOiBzaG91bGQgYmUgIm90Z2hzX2NvbnRyb2wiIGNvbnRyb2wtcGh5LW90Z2hzIGFuZCAicG93ZXIiIGZvcgorICAgb3RoZXIgdHlwZXMuCisKK29tYXBfY29udHJvbF91c2I6IG9tYXAtY29udHJvbC11c2JANGEwMDIzMDAgeworICAgICAgICBjb21wYXRpYmxlID0gInRpLGNvbnRyb2wtcGh5LW90Z2hzIjsKKyAgICAgICAgcmVnID0gPDB4NGEwMDIzM2MgMHg0PjsKKyAgICAgICAgcmVnLW5hbWVzID0gIm90Z2hzX2NvbnRyb2wiOworfTsK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ywgZGV2KGFkMiksIHNwaTAoY3MxKSwgc3BpMShjczEpCittcHAxICAgICAgICAgIDEgICAgICAgIGdwaW8sIGRldihhZDMpLCBzcGkwKG1vc2kpLCBzcGkxKG1vc2kpCittcHAyICAgICAgICAgIDIgICAgICAgIGdwaW8sIGRldihhZDQpLCBwdHAoZXZlbnRyZXEpLCBsZWQoYzApLCBhdWRpbyhzZGkpCittcHAzICAgICAgICAgIDMgICAgICAgIGdwaW8sIGRldihhZDUpLCBwdHAodHJpZ2dlbiksIGxlZChwMyksIGF1ZGlvKG1jbGspCittcHA0ICAgICAgICAgIDQgICAgICAgIGdwaW8sIGRldihhZDYpLCBzcGkwKG1pc28pLCBzcGkxKG1pc28pCittcHA1ICAgICAgICAgIDUgICAgICAgIGdwaW8sIGRldihhZDcpLCBzcGkwKGNzMiksIHNwaTEoY3MyKQorbXBwNiAgICAgICAgICA2ICAgICAgICBncGlvLCBkZXYoYWQwKSwgbGVkKHAxKSwgYXVkaW8ocmNsaykKK21wcDcgICAgICAgICAgNyAgICAgICAgZ3BpbywgZGV2KGFkMSksIHB0cChjbGspLCBsZWQocDIpLCBhdWRpbyhleHRjbGspCittcHA4ICAgICAgICAgIDggICAgICAgIGdwaW8sIGRldiAoYm9vdGNzKSwgc3BpMChjczApLCBzcGkxKGNzMCkKK21wcDkgICAgICAgICAgOSAgICAgICAgZ3BpbywgbmYod2VuKSwgc3BpMChzY2spLCBzcGkxKHNjaykKK21wcDEwICAgICAgICAxMCAgICAgICAgZ3BpbywgbmYocmVuKSwgZHJhbSh2dHRjdHJsKSwgbGVkKGMxKQorbXBwMTEgICAgICAgIDExICAgICAgICBncGlvLCBkZXYoYTApLCBsZWQoYzIpLCBhdWRpbyhzZG8pCittcHAxMiAgICAgICAgMTIgICAgICAgIGdwaW8sIGRldihhMSksIGF1ZGlvKGJjbGspCittcHAxMyAgICAgICAgMTMgICAgICAgIGdwaW8sIGRldihyZWFkeW4pLCBwY2llMChyc3RvdXRuKSwgcGNpZTE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MykKK21wcDMwICAgICAgICAzMCAgICAgICAgZ3BpbywgZ2UxKHR4ZDApLCBzcGkxKGNzMCkKK21wcDMxICAgICAgICAzMSAgICAgICAgZ3BpbywgZ2UxKHR4ZDEpLCBzcGkxKG1vc2kpCittcHAzMiAgICAgICAgMzIgICAgICAgIGdwaW8sIGdlMSh0eGQyKSwgc3BpMShzY2spLCBwdHAodHJpZ2dlbikKK21wcDMzICAgICAgICAzMyAgICAgICAgZ3BpbywgZ2UxKHR4ZDMpLCBzcGkxKG1pc28pCittcHAzNCAgICAgICAgMzQgICAgICAgIGdwaW8sIGdlMSh0eGNsa291dCksIHNwaTEoc2NrKQorbXBwMzUgICAgICAgIDM1ICAgICAgICBncGlvLCBnZTEocnhjdGwpLCBzcGkxKGNzMSksIHNwaTAoY3MyKQorbXBwMzYgICAgICAgIDM2ICAgICAgICBncGlvLCBwY2llMChjbGtyZXEpCittcHAzNyAgICAgICAgMzcgICAgICAgIGdwaW8sIHBjaWUwKGNsa3JlcSksIHRkbShpbnRuKSwgZ2UobWRjKQorbXBwMzggICAgICAgIDM4ICAgICAgICBncGlvLCBwY2llMShjbGtyZXEpLCBnZShtZGlvKQorbXBwMzkgICAgICAgIDM5ICAgICAgICBncGlvLCByZWYoY2xrb3V0KQorbXBwNDAgICAgICAgIDQwICAgICAgICBncGlvLCB1YXJ0MSh0eGQpCittcHA0MSAgICAgICAgNDEgICAgICAgIGdwaW8sIHVhcnQxKHJ4ZCkKK21wcDQyICAgICAgICA0MiAgICAgICAgZ3Bpbywgc3BpMShjczIpLCBsZWQoYzApCittcHA0MyAgICAgICAgNDMgICAgICAgIGdwaW8sIHNhdGEwKHByc250KSwgZHJhbSh2dHRjdHJsKQorbXBwNDQgICAgICAgIDQ0ICAgICAgICBncGlvLCBzYXRhMChwcnNudCkKK21wcDQ1ICAgICAgICA0NSAgICAgICAgZ3Bpbywgc3BpMChjczIpLCBwY2llMChyc3RvdXRuKQorbXBwNDYgICAgICAgIDQ2ICAgICAgICBncGlvLCBsZWQocDApLCBnZTAodHhkMCksIGdlMSh0eGQwKQorbXBwNDcgICAgICAgIDQ3ICAgICAgICBncGlvLCBsZWQocDEpLCBnZTAodHhkMSksIGdlMSh0eGQxKQorbXBwNDggICAgICAgIDQ4ICAgICAgICBncGlvLCBsZWQocDIpLCBnZTAodHhkMiksIGdlMSh0eGQyKQorbXBwNDkgICAgICAgIDQ5ICAgICAgICBncGlvLCBsZWQocDMpLCBnZTAodHhkMyksIGdlMSh0eGQzKQorbXBwNTAgICAgICAgIDUwICAgICAgICBncGlvLCBsZWQoYzApLCBnZTAocnhkMCksIGdlMShyeGQwKQorbXBwNTEgICAgICAgIDUxICAgICAgICBncGlvLCBsZWQoYzEpLCBnZTAocnhkMSksIGdlMShyeGQxKQorbXBwNTIgICAgICAgIDUyICAgICAgICBncGlvLCBsZWQoYzIpLCBnZTAocnhkMiksIGdlMShyeGQyKQorbXBwNTMgICAgICAgIDUzICAgICAgICBncGlvLCBwY2llMShyc3RvdXRuKSwgZ2UwKHJ4ZDMpLCBnZTEocnhkMykKK21wcDU0ICAgICAgICA1NCAgICAgICAgZ3BpbywgcGNpZTAocnN0b3V0biksIGdlMChyeGN0bCksIGdlMShyeGN0bCkKK21wcDU1ICAgICAgICA1NSAgICAgICAgZ3BpbywgZ2UwKHJ4Y2xrKSwgZ2UxKHJ4Y2xrKQorbXBwNTYgICAgICAgIDU2ICAgICAgICBncGlvLCBnZTAodHhjbGtvdXQpLCBnZTEodHhjbGtvdXQpCittcHA1NyAgICAgICAgNTcgICAgICAgIGdwaW8sIGdlMCh0eGN0bCksIGdlMSh0eGN0bCkKK21wcDU4ICAgICAgICA1OCAgICAgICAgZ3BpbywgbGVkKGMwKQorbXBwNTkgICAgICAgIDU5ICAgICAgICBncGlvLCBsZWQoYzEpCittcHA2MCAgICAgICAgNjAgICAgICAgIGdwaW8sIHVhcnQxKHR4ZCksIGxlZChjMikKK21wcDYxICAgICAgICA2MSAgICAgICAgZ3BpbywgaTJjMSh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FydmVsbCw4OGY2ODIwLXBpbmN0cmwiIG9yCisgICJtYXJ2ZWxsLDg4ZjY4MjgtcGluY3RybCIgZGVwZW5kaW5nIG9uIHRoZSBzcGVjaWZpYyB2YXJpYW50IG9mIHRoZQorICBTb0MgYmVpbmcgdXNlZC4KKy0gcmVnOiByZWdpc3RlciBzcGVjaWZpZXIgb2YgTVBQIHJlZ2lzdGVycworCitBdmFpbGFibGUgbXBwIHBpbnMvZ3JvdXBzIGFuZCBmdW5jdGlvbnM6CitOb3RlOiBicmFja2V0cyAoeCkgYXJlIG5vdCBwYXJ0IG9mIHRoZSBtcHAgbmFtZSBmb3IgbWFydmVsbCxmdW5jdGlvbiBhbmQgZ2l2ZW4KK29ubHkgZm9yIG1vcmUgZGV0YWlsZWQgZGVzY3JpcHRpb24gaW4gdGhpcyBkb2N1bWVudC4KKworbmFtZSAgICAgICAgICBwaW5zICAgICBmdW5jdGlvbnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CittcHAwICAgICAgICAgIDAgICAgICAgIGdwaW8sIHVhMChyeGQpCittcHAxICAgICAgICAgIDEgICAgICAgIGdwaW8sIHVhMCh0eGQpCittcHAyICAgICAgICAgIDIgICAgICAgIGdwaW8sIGkyYzAoc2NrKQorbXBwMyAgICAgICAgICAzICAgICAgICBncGlvLCBpMmMwKHNkYSkKK21wcDQgICAgICAgICAgNCAgICAgICAgZ3BpbywgZ2UobWRjKSwgdWExKHR4ZCksIHVhMChydHMpCittcHA1ICAgICAgICAgIDUgICAgICAgIGdwaW8sIGdlKG1kaW8pLCB1YTEocnhkKSwgdWEwKGN0cykKK21wcDYgICAgICAgICAgNiAgICAgICAgZ3BpbywgZ2UwKHR4Y2xrb3V0KSwgZ2UwKGNycyksIGRldihjczMpCittcHA3ICAgICAgICAgIDcgICAgICAgIGdwaW8sIGdlMCh0eGQwKSwgZGV2KGFkOSkKK21wcDggIC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NzMCksIHBjaWUxKHJzdG91dCkgWzFdCittcHAxOSAgICAgICAgIDE5ICAgICAgIGdwaW8sIGdlMChjb2wpLCBwdHAoZXZlbnRfcmVxKSwgcGNpZTAoY2xrcmVxKSwgc2F0YTEocHJzbnQpLCB1YTAoY3RzKQorbXBwMjAgICAgICAgICAyMCAgICAgICBncGlvLCBnZTAodHhjbGspLCBwdHAoY2xrKSwgcGNpZTEocnN0b3V0KSBbMV0sIHNhdGEwKHByc250KSwgdWEwKHJ0cykKK21wcDIxICAgICAgICAgMjEgICAgICAgZ3Bpbywgc3BpMChjczEpLCBnZTEocnhkMCksIHNhdGEwKHByc250KSwgc2QwKGNtZCksIGRldihib290Y3MpCittcHAyMiAgICAgICAgIDIyICAgICAgIGdwaW8sIHNwaTAobW9zaSksIGRldihhZDApCittcHAyMyAgICAgICAgIDIzICAgICAgIGdwaW8sIHNwaTAoc2NrKSwgZGV2KGFkMikKK21wcDI0ICAgICAgICAgMjQgICAgICAgZ3Bpbywgc3BpMChtaXNvKSwgdWEwKGN0cyksIHVhMShyeGQpLCBzZDAoZDQpLCBkZXYocmVhZHkpCittcHAyNSAgICAgICAgIDI1ICAgICAgIGdwaW8sIHNwaTAoY3MwKSwgdWEwKHJ0cyksIHVhMSh0eGQpLCBzZDAoZDUpLCBkZXYoY3MwKQorbXBwMjYgICAgICAgICAyNiAgICAgICBncGlvLCBzcGkwKGNzMiksIGkyYzEoc2NrKSwgc2QwKGQ2KSwgZGV2KGNzMSkKK21wcDI3ICAgICAgICAgMjcgICAgICAgZ3Bpbywgc3BpMChjczMpLCBnZTEodHhjbGtvdXQpLCBpMmMxKHNkYSksIHNkMChkNyksIGRldihjczIpCittcHAyOCAgICAgICAgIDI4ICAgICAgIGdwaW8sIGdlMSh0eGQwKSwgc2QwKGNsayksIGRldihhZDUpCittcHAyOSAgICAgICAgIDI5ICAgICAgIGdwaW8sIGdlMSh0eGQxKSwgZGV2KGFsZTApCittcHAzMCAgICAgICAgIDMwICAgICAgIGdwaW8sIGdlMSh0eGQyKSwgZGV2KG9lbikKK21wcDMxICAgICAgICAgMzEgICAgICAgZ3BpbywgZ2UxKHR4ZDMpLCBkZXYoYWxlMSkKK21wcDMyICAgICAgICAgMzIgICAgICAgZ3BpbywgZ2UxKHR4Y3RsKSwgZGV2KHdlbjApCittcHAzMyAgICAgICAgIDMzICAgICAgIGdwaW8sIG0oZGVjY19lcnIpLCBkZXYoYWQzKQorbXBwMzQgICAgICAgICAzNCAgICAgICBncGlvLCBkZXYoYWQxKQorbXBwMzUgICAgICAgICAzNSAgICAgICBncGlvLCByZWYoY2xrX291dDEpLCBkZXYoYTEpCittcHAzNiAgICAgICAgIDM2ICAgICAgIGdwaW8sIHB0cCh0cmlnX2dlbiksIGRldihhMCkKK21wcDM3ICAgICAgICAgMzcgICAgICAgZ3BpbywgcHRwKGNsayksIGdlMShyeGNsayksIHNkMChkMyksIGRldihhZDgpCittcHAzOCAgICAgICAgIDM4ICAgICAgIGdwaW8sIHB0cChldmVudF9yZXEpLCBnZTEocnhkMSksIHJlZihjbGtfb3V0MCksIHNkMChkMCksIGRldihhZDQpCittcHAzOSAgICAgICAgIDM5ICAgICAgIGdwaW8sIGkyYzEoc2NrKSwgZ2UxKHJ4ZDIpLCB1YTAoY3RzKSwgc2QwKGQxKSwgZGV2KGEyKQorbXBwNDAgICAgICAgICA0MCAgICAgICBncGlvLCBpMmMxKHNkYSksIGdlMShyeGQzKSwgdWEwKHJ0cyksIHNkMChkMiksIGRldihhZDYpCittcHA0MSAgICAgICAgIDQxICAgICAgIGdwaW8sIHVhMShyeGQpLCBnZTEocnhjdGwpLCB1YTAoY3RzKSwgc3BpMShjczMpLCBkZXYoYnVyc3QvbGFzdCkKK21wcDQyICAgICAgICAgNDIgICAgICAgZ3BpbywgdWExKHR4ZCksIHVhMChydHMpLCBkZXYoYWQ3KQorbXBwNDMgICAgICAgICA0MyAgICAgICBncGlvLCBwY2llMChjbGtyZXEpLCBtKHZ0dF9jdHJsKSwgbSh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iAgICAgICBncGlvLCBwY2llMChyc3RvdXQpLCBwY2llMShyc3RvdXQpIFsxXSwgdGRtMmMoaW50biksIGF1ZGlvKHNkaSksIHNkMChkNikKK21wcDUzICAgICAgICAgNTMgICAgICAgZ3Bpbywgc2F0YTEocHJzbnQpLCBzYXRhMChwcnNudCksIHRkbTJjKHJzdG4pLCBhdWRpbyhiY2xrKSwgc2QwKGQ3KQorbXBwNTQgICAgICAgICA1NCAgICAgICBncGlvLCBzYXRhMChwcnNudCksIHNhdGExKHByc250KSwgcGNpZTAocnN0b3V0KSwgcGNpZTEocnN0b3V0KSBbMV0sIHNkMChkMykKK21wcDU1ICAgICAgICAgNTUgICAgICAgZ3BpbywgdWExKGN0cyksIGdlKG1kaW8pLCBwY2llMShjbGtyZXEpIFsxXSwgc3BpMShjczEpLCBzZDAoZDApCittcHA1NiAgICAgICAgIDU2ICAgICAgIGdwaW8sIHVhMShydHMpLCBnZShtZGMpLCBtKGRlY2NfZXJyKSwgc3BpMShtb3NpKQorbXBwNTcgICAgICAgICA1NyAgICAgICBncGlvLCBzcGkxKHNjayksIHNkMChjbGspCittcHA1OCAgICAgICAgIDU4ICAgICAgIGdwaW8sIHBjaWUxKGNsa3JlcSkgWzFdLCBpMmMxKHNjayksIHBjaWUyKGNsa3JlcSksIHNwaTEobWlzbyksIHNkMChkMSkKK21wcDU5ICAgICAgICAgNTkgICAgICAgZ3BpbywgcGNpZTAocnN0b3V0KSwgaTJjMShzZGEpLCBwY2llMShyc3RvdXQpIFsxXSwgc3BpMShjczApLCBzZDAoZDIpCisKK1sxXTogb25seSBhdmFpbGFibGUgb24gODhGNjgyMCBhbmQgODhGNjgyOAorWzJdOiBvbmx5IGF2YWlsYWJsZSBvbiA4OEY2ODI4CmRpZmYgLS1naXQgYS9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3MvcGluY3RybC9tYXJ2ZWxsLGFybWFkYS14cC1waW5jdHJsLnR4dCBiL0RvY3VtZW50YXRpb24v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W5kcG9pbnQgZGVmaW5pdGlvbnMgYXMgZGVmaW5lZCBpbgorICAgRG9jdW1lbnRhdGlvbi9kZXZpY2V0cmVlL2JpbmRpbmdzL21lZGlhL3ZpZGVvLWludGVyZmFjZXMudHh0LAorICAgY29ycmVzcG9uZGluZyB0byB0aGUgZm91ciBpbnB1dHMgdG8gdGhlIEhETUkgbXVsdGlwbGV4ZXIuCisKK09wdGlvbmFsIHByb3BlcnRpZXM6CisgLSBkZGMtaTJjLWJ1czogcGhhbmRsZSBvZiBhbiBJMkMgY29udHJvbGxlciB1c2VkIGZvciBEREMgRURJRCBwcm9iaW5nCisKK2V4YW1wbGU6CisKKwlncHI6IGlvbXV4Yy1ncHJAMDIwZTAwMDAgeworCQkvKiAuLi4gKi8KKwl9OworCisgICAgICAgIGhkbWk6IGhkbWlAMDEyMDAwMCB7CisgICAgICAgICAgICAgICAgI2FkZHJlc3MtY2VsbHMgPSA8MT47CisgICAgICAgICAgICAgICAgI3NpemUtY2VsbHMgPSA8MD47CisgICAgICAgICAgICAgICAgY29tcGF0aWJsZSA9ICJmc2wsaW14NnEtaGRtaSI7CisgICAgICAgICAgICAgICAgcmVnID0gPDB4MDAxMjAwMDAgMHg5MDAwPjsKKyAgICAgICAgICAgICAgICBpbnRlcnJ1cHRzID0gPDAgMTE1IDB4MDQ+OworICAgICAgICAgICAgICAgIGdwciA9IDwmZ3ByPjsKKyAgICAgICAgICAgICAgICBjbG9ja3MgPSA8JmNsa3MgMTIzPiwgPCZjbGtzIDEyND47CisgICAgICAgICAgICAgICAgY2xvY2stbmFtZXMgPSAiaWFoYiIsICJpc2ZyIjsKKyAgICAgICAgICAgICAgICBkZGMtaTJjLWJ1cyA9IDwmaTJjMj47CisKKyAgICAgICAgICAgICAgICBwb3J0QDAgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVnID0gPDA+OworCisgICAgICAgICAgICAgICAgICAgICAgICBoZG1pX211eF8wOiBlbmRwb2ludCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmaXB1MV9kaTBfaGRtaT47CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBwb3J0QDEgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVnID0gPDE+OworCisgICAgICAgICAgICAgICAgICAgICAgICBoZG1pX211eF8xOiBlbmRwb2ludCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmaXB1MV9kaTFfaGRtaT47CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH07CisgICAgICAgIH07CmRpZmYgLS1naXQgYS9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3Mvc3RhZ2luZy9pbXgtZHJtL2xkYi50eHQgYi9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3Mvc3RhZ2luZy9pbXgtZHJtL2xkYi50eHQKaW5kZXggZWQ5Mzc3OC4uNTc4YTFmYyAxMDA2NDQKLS0tIGEvRG9jdW1lbnRhdGlvbi9kZXZpY2V0cmVlL2JpbmRpbmdzL3N0YWdpbmcvaW14LWRybS9sZGIudHh0CisrKyBiL0RvY3VtZW50YXRpb24vZGV2aWNldHJlZS9iaW5kaW5ncy9zdGFnaW5nL2lteC1kcm0vbGRiLnR4dApAQCAtNTAsMTIgKzUwLDE0IEBACiAKIFJlcXVpcmVkIHByb3BlcnRpZXM6CiAgLSByZWcgOiBzaG91bGQgYmUgPDA+IG9yIDwxPgotIC0gY3J0Y3MgOiBhIGxpc3Qgb2YgcGhhbmRsZXMgd2l0aCBpbmRleCBwb2ludGluZyB0byB0aGUgSVBVIGRpc3BsYXkgaW50ZXJmYWNlcwotICAgICAgICAgICB0aGF0IGNhbiBiZSB1c2VkIGFzIHZpZGVvIHNvdXJjZSBmb3IgdGhpcyBjaGFubmVsLgogIC0gZnN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K0NPTkZJR19ORVRMSU5LX01NQVA9eQorQ09ORklHX05FVExJTktfRElBRz15CitDT05GSUdfSVJEQT15CitDT05GSUdfSVJMQU49eQorQ09ORklHX0lSQ09NTT15CitDT05GSUdfSVJEQV9VTFRSQT15CitDT05GSUdfSVJEQV9DQUNIRV9MQVNUX0xTQVA9eQorQ09ORklHX0lSREFfRkFTVF9SUj15CitDT05GSUdfQVUxMDAwX0ZJUj15CitDT05GSUdfQlQ9eQorQ09ORklHX0JUX1JGQ09NTT15CitDT05GSUdfQlRfUkZDT01NX1RUWT15CitDT05GSUdfQlRfQk5FUD15CitDT05GSUdfQlRfQk5FUF9NQ19GSUxURVI9eQorQ09ORklHX0JUX0JORVBfUFJPVE9fRklMVEVSPXkKK0NPTkZJR19CVF9ISURQPXkKK0NPTkZJR19CVF9IQ0lCVFVTQj15CitDT05GSUdfQ0ZHODAyMTE9eQorQ09ORklHX0NGRzgwMjExX1dFWFQ9eQorQ09ORklHX01BQzgwMjExPXkKK0NPTkZJR19ERVZUTVBGUz15CitDT05GSUdfREVWVE1QRlNfTU9VTlQ9eQorQ09ORklHX01URD15CitDT05GSUdfTVREX0NNRExJTkVfUEFSVFM9eQorQ09ORklHX01URF9CTE9DSz15CitDT05GSUdfTVREX0NGST15CitDT05GSUdfTVREX0NGSV9BRFZfT1BUSU9OUz15CitDT05GSUdfTVREX0NGSV9BTURTVEQ9eQorQ09ORklHX01URF9QSFlTTUFQPXkKK0NPTkZJR19NVERfTTI1UDgwPXkKK0NPTkZJR19NVERfU1NUMjVMPXkKK0NPTkZJR19NVERfTkFORD15CitDT05GSUdfTVREX05BTkRfRUNDX0JDSD15CitDT05GSUdfTVREX05BTkRfQVUxNTUwPXkKK0NPTkZJR19NVERfTkFORF9QTEFURk9STT15CitDT05GSUdfRUVQUk9NX0FUMjQ9eQorQ09ORklHX0VFUFJPTV9BVDI1PXkKK0NPTkZJR19TQ1NJX1RHVD15CitDT05GSUdfQkxLX0RFVl9TRD15CitDT05GSUd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RV9DTURFRlRHVF9NU0s7CisJYmFzZV9yZWcgfD0gQ01fR0NSX0JBU0VfQ01ERUZUR1RfTUVNOworCXdyaXRlX2djcl9iYXNlKGJhc2VfcmVnKTsKKworCS8qIGRpc2FibGUgQ00gcmVnaW9ucyAqLworCXdyaXRlX2djcl9yZWcwX2Jhc2UoQ01fR0NSX1JFR25fQkFTRV9CQVNFQUREUl9NU0spOworCXdyaXRlX2djcl9yZWcwX21hc2soQ01fR0NSX1JFR25fTUFTS19BRERSTUFTS19NU0spOworCXdyaXRlX2djcl9yZWcxX2Jhc2UoQ01fR0NSX1JFR25fQkFTRV9CQVNFQUREUl9NU0spOworCXdyaXRlX2djcl9yZWcxX21hc2soQ01fR0NSX1JFR25fTUFTS19BRERSTUFTS19NU0spOworCXdyaXRlX2djcl9yZWcyX2Jhc2UoQ01fR0NSX1JFR25fQkFTRV9CQVNFQUREUl9NU0spOworCXdyaXRlX2djcl9yZWcyX21hc2soQ01fR0NSX1JFR25fTUFTS19BRERSTUFTS19NU0spOworCXdyaXRlX2djcl9yZWczX2Jhc2UoQ01fR0NSX1JFR25fQkFTRV9CQVNFQUREUl9NU0spOworCXdyaXRlX2djcl9yZWczX21hc2soQ01fR0NSX1JFR25fTUFTS19BRERSTUFTS19NU0spOworCisJLyogcHJvYmUgZm9yIGFuIEwyLW9ubHkgc3luYyByZWdpb24gKi8KKwltaXBzX2NtX3Byb2JlX2wyc3luYygpOworCisJcmV0dXJuIDA7Cit9CmRpZmYgLS1naXQgYS9hcmNoL21pcHMva2VybmVsL21pcHMtY3BjLmMgYi9hcmNoL21pcHMva2VybmVsL21pcHMtY3BjLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzlkYzY3NAotLS0gL2Rldi9udWxsCisrKyBiL2FyY2gvbWlwcy9rZXJuZWwvbWlwcy1jcGMuYwpAQCAtMCwwICsxLDUyIEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDEzIEltYWdpbmF0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wgdmFsdWUsIHJlcykgIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCIuc2V0XHRub2F0XG4iICAgICAgICBcCi0JCQkiMTpcdGxiXHQlMCwgMCglMilcbiIgICAgICAgICAgICAgICBcCi0JCQkiMjpcdGxidVx0JDEsIDEoJTIpXG5cdCIgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX2xiKCIlMCIsICIwKCUyKSIpIlxuIiAgICBcCisJCQkiMjpcdCJ1c2VyX2xidSgiJDEiLCAiMSglMikiKSJcblx0IiBcCiAJCQkic2xsXHQlMCwgMHg4XG5cdCIgICAgICAgICAgICAgICAgICBcCiAJCQkib3JcdCUwLCAkMVxuXHQiICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUxLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0xMzAsOCArMTMxLDggQEAKIAogI2RlZmluZSAgICAgTG9hZFcoYWRkciwgdmFsdWUsIHJlcykgICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsd2xcdCUwLCAoJTIpXG4iICAgICAgICAgICAgICAgXAotCQkJIjI6XHRsd3JcdCUwLCAzKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sd2woIiUwIiwgIiglMikiKSJcbiIgICAgXAorCQkJIjI6XHQidXNlcl9sd3IoIiUwIiwgIjMoJTIpIikiXG5cdCIgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5pbnNuXG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMTQ5LDggKzE1MCw4IEBACiAjZGVmaW5lICAgICBMb2FkSFdVKGFkZHIsIHZhbHVlLCByZXMpIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiLnNldFx0bm9hdFxuIiAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkiMTpcdGxidVx0JTAsIDAoJTIpXG4iICAgICAgICAgICAgICBcCi0JCQkiMjpcdGxidVx0JDEsIDEoJTIpXG5cdCIgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX2xidSgiJTAiLCAiMCglMikiKSJcbiIgICBcCisJCQkiMjpcdCJ1c2VyX2xidSgiJDEiLCAiMSglMikiKSJcblx0IiBcCiAJCQkic2xsXHQlMCwgMHg4XG5cdCIgICAgICAgICAgICAgICAgICBcCiAJCQkib3JcdCUwLCAkMVxuXHQiICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUxLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0xNzAsOCArMTcxLDggQEAKIAogI2RlZmluZSAgICAgTG9hZFdVKGFkZHIsIHZhbHVlLCByZXMpICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsd2xcdCUwLCAoJTIpXG4iICAgICAgICAgICAgICAgXAotCQkJIjI6XHRsd3JcdCUwLCAzKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sd2woIiUwIiwgIiglMikiKSJcbiIgICAgXAorCQkJIjI6XHQidXNlcl9sd3IoIiUwIiwgIjMoJTIpIikiXG5cdCIgXAogCQkJImRzbGxcdCUwLCAlMCwgMzJcblx0IiAgICAgICAgICAgICAgXAogCQkJImRzcmxcdCUwLCAlMCwgMzJcblx0IiAgICAgICAgICAgICAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMjA5LDkgKzIxMCw5IEBACiAjZGVmaW5lICAgICBTdG9yZUhXKGFkZHIsIHZhbHVlLCByZXMpIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiLnNldFx0bm9hdFxuIiAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkiMTpcdHNiXHQlMSwgMSglMilcblx0IiAgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX3NiKCIlMSIsICIxKCUyKSIpIlxuIiAgICBcCiAJCQkic3JsXHQkMSwgJTEsIDB4OFxuIiAgICAgICAgICAgICAgICBcCi0JCQkiMjpcdHNiXHQkMSwgMCglMilcblx0IiAgICAgICAgICAgICBcCisJCQkiMjpcdCJ1c2VyX3NiKCIkMSIsICIwKCUyKSIpIlxuIiAgICBcCiAJCQkiLnNldFx0YXRcblx0IiAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUwLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiMzpcblx0IiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0yMjksOCArMjMwLDggQEAKIAogI2RlZmluZSAgICAgU3RvcmVXKGFkZHIsIHZhbHVlLCByZXMpICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRzd2xcdCUxLCglMilcbiIgICAgICAgICAgICAgICAgXAotCQkJIjI6XHRzd3JcdCUxLCAzKCUyKVxuXHQiICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9zd2woIiUxIiwgIiglMikiKSJcbiIgICAgXAorCQkJIjI6XHQidXNlcl9zd3IoIiUxIiwgIjMoJTIpIikiXG5cdCIgXAogCQkJImxpXHQlMCwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5pbnNuXG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMjY3LDggKzI2OCw4IEBACiAjaWZkZWYgX19MSVRUTEVfRU5ESUFOCiAjZGVmaW5lICAgICBMb2FkSFcoYWRkciwgdmFsdWUsIHJlcykgIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCIuc2V0XHRub2F0XG4iICAgICAgICBcCi0JCQkiMTpcdGxiXHQlMCwgMSglMilcbiIgICAgICAgICAgICAgICBcCi0JCQkiMjpcdGxidVx0JDEsIDAoJTIpXG5cdCIgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX2xiKCIlMCIsICIxKCUyKSIpIlxuIiAgICBcCisJCQkiMjpcdCJ1c2VyX2xidSgiJDEiLCAiMCglMikiKSJcblx0IiBcCiAJCQkic2xsXHQlMCwgMHg4XG5cdCIgICAgICAgICAgICAgICAgICBcCiAJCQkib3JcdCUwLCAkMVxuXHQiICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUxLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0yODcsOCArMjg4LDggQEAKIAogI2RlZmluZSAgICAgTG9hZFcoYWRkciwgdmFsdWUsIHJlcykgICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsd2xcdCUwLCAzKCUyKVxuIiAgICAgICAgICAgICAgXAotCQkJIjI6XHRsd3JcdCUwLCAoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sd2woIiUwIiwgIjMoJTIpIikiXG4iICAgXAorCQkJIjI6XHQidXNlcl9sd3IoIiUwIiwgIiglMikiKSJcblx0IiAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5pbnNuXG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMzA2LDggKzMwNyw4IEBACiAjZGVmaW5lICAgICBMb2FkSFdVKGFkZHIsIHZhbHVlLCByZXMpIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiLnNldFx0bm9hdFxuIiAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkiMTpcdGxidVx0JTAsIDEoJTIpXG4iICAgICAgICAgICAgICBcCi0JCQkiMjpcdGxidVx0JDEsIDAoJTIpXG5cdCIgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX2xidSgiJTAiLCAiMSglMikiKSJcbiIgICBcCisJCQkiMjpcdCJ1c2VyX2xidSgiJDEiLCAiMCglMikiKSJcblx0IiBcCiAJCQkic2xsXHQlMCwgMHg4XG5cdCIgICAgICAgICAgICAgICAgICBcCiAJCQkib3JcdCUwLCAkMVxuXHQiICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUxLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0zMjcsOCArMzI4LDggQEAKIAogI2RlZmluZSAgICAgTG9hZFdVKGFkZHIsIHZhbHVlLCByZXMpICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRsd2xcdCUwLCAzKCUyKVxuIiAgICAgICAgICAgICAgXAotCQkJIjI6XHRsd3JcdCUwLCAoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9sd2woIiUwIiwgIjMoJTIpIikiXG4iICAgXAorCQkJIjI6XHQidXNlcl9sd3IoIiUwIiwgIiglMikiKSJcblx0IiAgXAogCQkJImRzbGxcdCUwLCAlMCwgMzJcblx0IiAgICAgICAgICAgICAgXAogCQkJImRzcmxcdCUwLCAlMCwgMzJcblx0IiAgICAgICAgICAgICAgXAogCQkJImxpXHQlMSwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtMzY2LDkgKzM2Nyw5IEBACiAjZGVmaW5lICAgICBTdG9yZUhXKGFkZHIsIHZhbHVlLCByZXMpIFwKIAkJX19hc21fXyBfX3ZvbGF0aWxlX18gKCAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiLnNldFx0bm9hdFxuIiAgICAgICAgICAgICAgICAgICAgICBcCi0JCQkiMTpcdHNiXHQlMSwgMCglMilcblx0IiAgICAgICAgICAgICBcCisJCQkiMTpcdCJ1c2VyX3NiKCIlMSIsICIwKCUyKSIpIlxuIiAgICBcCiAJCQkic3JsXHQkMSwlMSwgMHg4XG4iICAgICAgICAgICAgICAgICBcCi0JCQkiMjpcdHNiXHQkMSwgMSglMilcblx0IiAgICAgICAgICAgICBcCisJCQkiMjpcdCJ1c2VyX3NiKCIkMSIsICIxKCUyKSIpIlxuIiAgICBcCiAJCQkiLnNldFx0YXRcblx0IiAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkibGlcdCUwLCAwXG4iICAgICAgICAgICAgICAgICAgICAgICBcCiAJCQkiMzpcblx0IiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0zODYsOCArMzg3LDggQEAKIAogI2RlZmluZSAgICAgU3RvcmVXKGFkZHIsIHZhbHVlLCByZXMpICBcCiAJCV9fYXNtX18gX192b2xhdGlsZV9fICggICAgICAgICAgICAgICAgICAgICAgXAotCQkJIjE6XHRzd2xcdCUxLCAzKCUyKVxuIiAgICAgICAgICAgICAgXAotCQkJIjI6XHRzd3JcdCUxLCAoJTIpXG5cdCIgICAgICAgICAgICAgXAorCQkJIjE6XHQidXNlcl9zd2woIiUxIiwgIjMoJTIpIikiXG4iICAgXAorCQkJIjI6XHQidXNlcl9zd3IoIiUxIiwgIiglMikiKSJcblx0IiAgXAogCQkJImxpXHQlMCwgMFxuIiAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIjM6XG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogCQkJIi5pbnNuXG5cdCIgICAgICAgICAgICAgICAgICAgICAgICAgXApAQCAtNDMwLDcgKzQzMSw5IEBACiAJdW5zaWduZWQgbG9uZyBvcmlncGM7CiAJdW5zaWduZWQgbG9uZyBvcmlnMzE7CiAJdm9pZCBfX3VzZXIgKmZhdWx0X2FkZHIgPSBOVUxMOwotCisjaWZk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V0sICVbYmFzZV0sICVbY29yZV0gICBcbiIKKwkJIiAgIGFuZGkgICVbbm9kZV0sICVbY3B1aWRdLCAweGMgICAgICBcbiIKKwkJIiAgIGRzbGwgICVbbm9kZV0sIDQyICAgICAgICAgICAgICAgICBcbiIgLyogZ2V0IG5vZGUgaWQgKi8KKwkJIiAgIG9yICAgICVbYmFzZV0sICVbYmFzZV0sICVbbm9kZV0gICBcbiIKKwkJIjE6IGxpICAgICVbY291bnRdLCAweDEwMCAgICAgICAgICAgICBcbiIgLyogd2FpdCBmb3IgaW5pdCBsb29wICovCisJCSIyOiBibmV6ICAlW2NvdW50XSwgMmIgICAgICAgICAgICAgICAgXG4iIC8qIGxpbWl0IG1haWxib3ggYWNjZXNzICovCisJCSIgICBhZGRpdSAlW2NvdW50XSwgLTEgICAgICAgICAgICAgICAgXG4iCisJCSIgICBsZCAgICAlW2luaXRmdW5jXSwgMHgyMCglW2Jhc2VdKSAgXG4iIC8qIGdldCBQQyB2aWEgbWFpbGJveCAqLworCQkiICAgYmVxeiAgJVtpbml0ZnVuY10sIDFiICAgICAgICAgICAgIFxuIgorCQkiICAgbm9wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuIgorCQkiICAgbGQgICAgJHNwLCAweDI4KCVbYmFzZV0pICAgICAgICAgIFxuIiAvKiBnZXQgU1AgdmlhIG1haWxib3ggKi8KKwkJIiAgIGxkICAgICRncCwgMHgzMCglW2Jhc2VdKSAgICAgICAgICBcbiIgLyogZ2V0IEdQIHZpYSBtYWlsYm94ICovCisJCSIgICBsZCAgICAkYTEsIDB4MzgoJVtiYXNlXSkgICAgICAgICAgXG4iCisJCSIgICBqciAgICAlW2luaXRmdW5jXSAgICAgICAgICAgICAgICAgXG4iIC8qIGp1bXAgdG8gaW5pdGlhbCBQQyAqLworCQkiICAgbm9wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuIgorCQkiICAgLnNldCBwb3AgICAgICAgICAgICAgICAgICAgICAgICAgIFxuIg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BkID0gQGRlc3QgYnVmZmVyCisgKiAnLicgYXJlYXMgaW4gZCBhcmUgd3JpdHRlbiB0by4KKyAqCisgKiAgICAgICAgICAgICAgICAgICAgICAgdQorICogICB4ICAgICAgICAgdwkgdiAgegorICogZCAgICAgICAgICAgfC4uLi4uLi4uLnwKKyAqIHMgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS18CisgKgorICogICAgICAgICAgICAgICAgICAgICAgdQorICogICB4ICAgICAgICAgdwl6ICAgICB2CisgKiBkICAgICAgICAgICB8Li4uLi4uLi4tLS0tLS18CisgKiBzIHwtLS0tLS0tLS0tLS0tLS0tLS18CisgKgorICogICB4ICAgICAgICAgdyAgICAgICAgdSx6LHYKKyAqIGQgICAgICAgICAgIHwuLi4uLi4uLnwKKyAqIHMgfC0tLS0tLS0tLS0tLS0tLS0tLXwKKyAqCisgKiAgIHgsdyAgICAgICAgICAgICAgICB1LHYsegorICogZCB8Li4uLi4uLi4uLi4uLi4uLi4ufAorICogcyB8LS0tLS0tLS0tLS0tLS0tLS0tfAorICoKKyAqICAgeCAgICAgICAgdQorICogICB3ICAgICAgICB2CQl6CisgKiBkIHwuLi4uLi4uLnwKKyAqIHMgfC0tLS0tLS0tLS0tLS0tLS0tLXwKKyAqCisgKiAgIHggICAgICB6ICAgdyAgICAgIHYKKyAqIGQgICAgICAgICAgICB8LS0tLS0tfAorICogcyB8LS0tLS0tfAorICoKKyAqIHggPSBzb3VyY2Vfb2Zmc2V0CisgKiB3ID0gcmVxdWVzdGVkX29mZnNldAorICogeiA9IHNvdXJjZV9vZmZzZXQgKyBzcmNfbGVuCisgKiB2ID0gcmVxdWVzdGVkX29mZnNldCArIGRlc3RfbGVuCisgKgorICogd19vZmZzZXRfaW5fcyA9IHcgLSB4ID0gcmVxdWVzdGVkX29mZnNldCAtIHNvdXJjZV9vZmZzZXQKKyAqIHpfb2Zmc2V0X2luX3MgPSB6IC0geCA9IHNyY19sZW4KKyAqIHZfb2Zmc2V0X2luX3MgPSB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gICAgICAgICAgICAgICAweDBkMDlhKQogRVZFTlQoUE1fSUZVX0ZJTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4NDAwNjYpCitFVkVOVChQTV8xVEhSRF9DT05fUlVOX0lOU1RSLCAgICAgICAgICAgICAgICAgMHgzMDA2MikKK0VWRU5UKFBNX0NNUExVX1NUQUxMX0NPVU5ULCAgICAgICAgICAgICAgICAgICAweDQwMDBCKQorRVZFTlQoUE1fTUVNMF9QQl9SRF9DTCwgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwODMpCitFVkVOVChQTV9USFJEXzFfUlVOX0NZQywgICAgICAgICAgICAgICAgICAgICAgMHgxMDA2MCkKK0VWRU5UKFBNX1RIUkRfMl9DT05DX1JVTl9JTlNUUiwgICAgICAgICAgICAgICAweDQwMDYyKQorRVZFTlQoUE1fVEhSRF8yX1JVTl9DWUMsICAgICAgICAgICAgICAgICAgICAgIDB4MjAwNjApCitFVkVOVChQTV9USFJEXzNfQ09OQ19SVU5fSU5TVCwgICAgICAgICAgICAgICAgMHgxMDA2MikKK0VWRU5UKFBNX1RIUkRfM19SVU5fQ1lDLCAgICAgICAgICAgICAgICAgICAgICAweDMwMDYwKQorRVZFTlQoUE1fVEhSRF80X0NPTkNfUlVOX0lOU1QsICAgICAgICAgICAgICAgIDB4MjAwNjIpCitFVkVOVChQTV9USFJEXzRfUlVOX0NZQywgICAgICAgICAgICAgICAgICAgICAgMHg0MDA2MCkKZGlmZiAtLWdpdCBhL2FyY2gvcG93ZXJwYy9wZXJmL3Bvd2VyOC1wbXUuYyBiL2FyY2gvcG93ZXJwYy9wZXJmL3Bvd2VyOC1wbXUuYwppbmRleCA5NmNlZTIwLi5mZTI3NjNiIDEwMDY0NAotLS0gYS9hcmNoL3Bvd2VycGMvcGVyZi9wb3dlcjgtcG11LmMKKysrIGIvYXJjaC9wb3dlcnBjL3BlcmYvcG93ZXI4LXBtdS5jCkBAIC0xMCw2ICsxMCw4IEBACiAgKiAyIG9mIHRoZSBMaWNlbnNlLCBvciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLgogICovCiAKKyNkZWZpbmUgcHJfZm10KGZtdCkJInBvd2VyOC1wbXU6ICIgZm10CisKICNpbmNsdWRlIDxsaW51eC9rZXJuZWwuaD4KICNpbmNsdWRlIDxsaW51eC9wZXJmX2V2ZW50Lmg+CiAjaW5jbHVkZSA8YXNtL2Zpcm13YXJlLmg+CkBAIC02Miw5ICs2NCwxMSBAQAogICoKICAqICAgICAgICA2MCAgICAgICAgNTYgICAgICAgIDUyICAgICAgICA0OCAgICAgICAgNDQgICAgICAgIDQwICAgICAgICAzNiAgICAgICAgMzIKICAqIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfAotICogICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyAgICAgIHRocmVzaF9jbXAgICAgIF0gICBbICB0aHJlc2hfY3RsICAgXQotICogICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAqICAgKi0gRUJCIChMaW51eCkgICAgICAgICAgICAgICAgICAgICAgdGhyZXNoIHN0YXJ0L3N0b3AgT1IgRkFCIG1hdGNoIC0qCisgKiAgIHwgfCBbIF0gICAgICAgICAgICAgICAgICAgICAgICAgICBbICAgICAgdGhyZXNoX2NtcCAgICAgXSAgIFsgIHRocmVzaF9jdGwgICBdCisgKiAgIHwgfCAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAorICogICB8IHwgICotIElGTSAoTGludXgpICAgICAgICAgICAgICAgICB0aHJlc2ggc3RhcnQvc3RvcCBPUiBGQUIgbWF0Y2ggLSoKKyAqICAgfCAqLSBCSFJCIChMaW51eCkKKyA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ICAgICAgICAyOCAgICAgICAgMjQgICAgICAgIDIwICAgICAgICAxNiAgICAgICAgMTIgICAgICAgICA4ICAgICAgICAgNCAgICAgICAgIDAKICAqIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfCAtIC0gLSAtIHwgLSAtIC0gLSB8IC0gLSAtIC0gfAotICogICAgICAgICAgICAgICAgICAgfCAgIFsgXSAgIFsgIHNhbXBsZSBdICAgWyAgICAgXSAgIFs2XSBbNV0gICBbNF0gWzNdICAgWzJdIFsxXQotICogICAgICAgICAgICAgIEVCQiAtKiAgICB8ICAgICAgICAgICAgICAgICAgICAgfAotICogICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgIENvdW50IG9mIGV2ZW50cyBmb3IgZWFjaCBQTUMuCi0gKiAgICAgIEwxIEkvRCBxdWFsaWZpZXIgLSogICAgICAgICAgICAgICAgICAgICB8ICAgICAgICBwMSwgcDIsIHAzLCBwNCwgcDUsIHA2LgorICogICAgICAgICAgICAgICBbIF0gfCAgIFsgXSAgIFsgIHNhbXBsZSBdICAgWyAgICAgXSAgIFs2XSBbNV0gICBbNF0gWzNdICAgWzJdIFsxXQorICogICAgICAgICAgICAgICAgfCAgfCAgICB8ICAgICAgICAgICAgICAgICAgICAgfAorICogICAgICBCSFJCIElGTSAtKiAgfCAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgIENvdW50IG9mIGV2ZW50cyBmb3IgZWFjaCBQTUMuCisgKiAgICAgICAgICAgICAgRUJCIC0qICAgIHwgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICBwMSwgcDIsIHAzLCBwNCwgcDUsIHA2LgorICogICAgICBMMSBJL0QgcXVhbGlmaWVyIC0qICAgICAgICAgICAgICAgICAgICAgfAogICogICAgICAgICAgICAgICAgICAgICBuYyAtIG51bWJlciBvZiBjb3VudGVycyAtKgogICoKICAqIFRoZSBQTUMgZ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ICAgLyogICAgICAgICAgICAgICAgICAgICBpbnRzIGZ3ZGVkIHRvIGFub3RoZXIgWEFQSUMgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgIEJpdHMxOjcgUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIENZQzogIEJpdHMwOjcgUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1bnNpZ25lZCBjaGFyIFdQX2luZGV4OyAgICAgLyogRm9yIFdQRUc6IFdQRUcgaW5zdGFuY2UgaW5kZXggLSBsb3dlciBvbmVzIGhhdmUgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgIGxvd2VyIHNsb3QgbnVtYmVycy9QQ0kgYnVzIG51bWJlcnMgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIENZQzogIE5vIG1lYW5pbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1bnNpZ25lZCBjaGFyIGNoYXNzaXNfbnVtOyAgLyogMSBiYXNlZCBDaGFzc2lzIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yIExvb2tPdXQgV1BFR3MgdGhpcyBmaWVsZCBpbmRpY2F0ZXMgdGhlICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRXhwYW5zaW9uIENoYXNzaXMgIywgZW51bWVyYXRlZCBmcm9tIEJvb3QgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTm9kZSBXUEVHIGV4dGVybmFsIHBvcnQsIHRoZW4gQm9vdCBOb2RlIENZQyAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZXh0ZXJuYWwgcG9ydCwgdGhlbiBOZXh0IFZpZ2lsIGNoYXNzaXMgV1BFRyAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZXh0ZXJuYWwgcG9ydCwgZXRjLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hhcmVkIExvb2tvdXRzIGhhdmUgb25seSAxIGNoYXNzaXMgbnVtYmVyICh0aGUgKi8KLQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgb25lIGFzc2lnbmVkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gX19hdHRyaWJ1dGVfXygocGFja2VkKSk7Ci0KLQotdHlwZWRlZiBlbnVtIHsKLQlDb21wYXRUd2lzdGVyID0gMCwgIC8qIENvbXBhdGliaWxpdHkgVHdpc3RlciAgICAgICAgICAgICAgICovCi0JQWx0VHdpc3RlciAgICA9IDEsICAvKiBBbHRlcm5hdGUgVHdpc3RlciBvZiBpbnRlcm5hbCA4LXdheSAqLwotCUNvbXBhdEN5Y2xvbmUgPSAyLCAgLyogQ29tcGF0aWJpbGl0eSBDeWNsb25lICAgICAgICAgICAgICAgKi8KLQlBbHRDeWNsb25lICAgID0gMywgIC8qIEFsdGVybmF0ZSBDeWNsb25lIG9mIGludGVybmFsIDgtd2F5ICovCi0JQ29tcGF0V1BFRyAgICA9IDQsICAvKiBDb21wYXRpYmlsaXR5IFdQRUcgICAgICAgICAgICAgICAgICAqLwotCUFsdFdQRUcgICAgICAgPSA1LCAgLyogU2Vjb25kIFBsYW5hciBXUEVHICAgICAgICAgICAgICAgICAgKi8KLQlMb29rT3V0QVdQRUcgID0gNiwgIC8qIExvb2tPdXQgV1BFRyAgICAgICAgICAgICAgICAgICAgICAgICovCi0JTG9va091dEJXUEVHICA9IDcsICAvKiBMb29rT3V0IFdQRUcgICAgICAgICAgICAgICAgICAgICAgICAqLwotfSBub2RlX3R5cGU7Ci0KLXN0YXRpYyBpbmxpbmUgaW50IG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2Vzbid0IGNoYW5nZSB0aGUgb3V0cHV0CisgKiBhcmd1bWVudCBAbS4KKyAqCisgKi8KK2ludCBtc3JfcmVhZCh1MzIgbXNyLCBzdHJ1Y3QgbXNyICptKQoreworCWludCBlcnI7CisJdTY0IHZhbDsKKworCWVyciA9IHJkbXNybF9zYWZlKG1zciwgJnZhbCk7CisJaWYgKCFlcnIpCisJCW0tPnEgPSB2YWw7CisKKwlyZXR1cm4gZXJyOworfQorCisvKioKKyAqIFdyaXRlIGFuIE1TUiB3aXRoIGVycm9yIGhhbmRsaW5nCisgKgorICogQG1zcjogTVNSIHRvIHdyaXRlCisgKiBAbTogdmFsdWUgdG8gd3JpdGUKKyAqLworaW50IG1zcl93cml0ZSh1MzIgbXNyLCBzdHJ1Y3QgbXNyICptKQoreworCXJldHVybiB3cm1zcmxfc2FmZShtc3IsIG0tPnEpOworfQorCitzdGF0aWMgaW5saW5lIGludCBfX2ZsaXBfYml0KHUzMiBtc3IsIHU4IGJpdCwgYm9vbCBzZXQpCit7CisJc3RydWN0IG1zciBtLCBtMTsKKwlpbnQgZXJyID0gLUVJTlZBTDsKKworCWlmIChiaXQgPiA2MykKKwkJcmV0dXJuIGVycjsKKworCWVyciA9IG1zcl9yZWFkKG1zciwgJm0pOworCWlmIChlcnIpCisJCXJldHVybiBlcnI7CisKKwltMSA9IG07CisJaWYgKHNldCkKKwkJbTEucSB8PSAgQklUXzY0KGJpdCk7CisJZWxzZQorCQltMS5xICY9IH5CSVRfNjQoYml0KTsKKworCWlmIChtMS5xID09IG0ucSkKKwkJcmV0dXJuIDA7CisKKwllcnIgPSBtc3Jfd3JpdGUobXNyLCAmbSk7CisJaWYgKGVycikKKwkJcmV0dXJuIGVycjsKKworCXJldHVybiAxOworfQorCisvKioKKyAqIFNldCBAYml0IGluIGEgTVNSIEBtc3IuCisgKgorICogUmV0dmFsOgorICogPCAwOiBBbiBlcnJvciB3YXMgZW5jb3VudGVyZWQuCisgKiA9IDA6IEJpdCB3YXMgYW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JLyogTm90IHByZXNlbnQgKi8KLQkJc2VxX3ByaW50ZihtLCAiICAgICAgICAgICAgICAgICAgICAgICAgICAiKTsKKwkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiICAgICAgICAgICAgICAgICAgICAgICAgICAiKTsKIAl9IGVsc2UgewogCQlpZiAocHIgJiBfUEFHRV9VU0VSKQotCQkJc2VxX3ByaW50ZihtLCAiVVNSICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiVVNSICIpOwogCQllbHNlCi0JCQlzZXFfcHJpbnRmKG0sICIgICAgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICIgICAgIik7CiAJCWlmIChwciAmIF9QQUdFX1JXKQotCQkJc2VxX3ByaW50ZihtLCAiUlcgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICJSVyAiKTsKIAkJZWxzZQotCQkJc2VxX3ByaW50ZihtLCAicm8gIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICJybyAiKTsKIAkJaWYgKHByICYgX1BBR0VfUFdUKQotCQkJc2VxX3ByaW50ZihtLCAiUFdUICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiUFdUICIpOwogCQllbHNlCi0JCQlzZXFfcHJpbnRmKG0sICIgICAgIik7CisJCQlwdF9kdW1wX2NvbnRfcHJpbnRmKG0sIGRtc2csICIgICAgIik7CiAJCWlmIChwciAmIF9QQUdFX1BDRCkKLQkJCXNlcV9wcmludGYobSwgIlBDRCAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIlBDRCAiKTsKIAkJZWxzZQotCQkJc2VxX3ByaW50ZihtLCAiICAgICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiICAgICIpOwogCiAJCS8qIEJpdCA5IGhhcyBhIGRpZmZlcmVudCBtZWFuaW5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MgPSB7CisJLnJlYWQgICAgICAgICAgID0gZmNvcHlfcmVhZCwKKwkud3JpdGUgICAgICAgICAgPSBmY29weV93cml0ZSwKKwkucmVsZWFzZQk9IGZjb3B5X3JlbGVhc2UsCisJLm9wZW4JCT0gZmNvcHlfb3BlbiwKK307CisKK3N0YXRpYyBzdHJ1Y3QgbWlzY2RldmljZSBmY29weV9taXNjID0geworCS5taW5vciAgICAgICAgICA9IE1JU0NfRFlOQU1JQ19NSU5PUiwKKwkubmFtZSAgICAgICAgICAgPSAidm1idXMvaHZfZmNvcHkiLAorCS5mb3BzICAgICAgICAgICA9ICZmY29weV9mb3BzLAorfTsKKworc3RhdGljIGludCBmY29weV9kZXZfaW5pdCh2b2lkKQoreworCXJldHVybiBtaXNjX3JlZ2lzdGVyKCZmY29weV9taXNjKTsKK30KKworc3RhdGljIHZvaWQgZmNvcHlfZGV2X2RlaW5pdCh2b2lkKQoreworCisJLyoKKwkgKiBUaGUgZGV2aWNlIGlzIGdvaW5nIGF3YXkgLSBwZXJoYXBzIGJlY2F1c2UgdGhlCisJICogaG9zdCBoYXMgcmVzY2luZGVkIHRoZSBjaGFubmVsLiBTZXR1cCBzdGF0ZSBzbyB0aGF0CisJICogdXNlciBsZXZlbCBkYWVtb24gY2FuIGdyYWNlZnVsbHkgZXhpdCBpZiBpdCBpcyBibG9ja2VkCisJICogb24gdGhlIHJlYWQgc2VtYXBob3JlLgorCSAqLworCW9wZW5lZCA9IGZhbHNlOworCS8qCisJICogU2lnbmFsIHRoZSBzZW1hcGhvcmUgYXMgdGhlIGRldmljZSBpcworCSAqIGdvaW5nIGF3YXkuCisJICovCisJdXAoJmZjb3B5X3RyYW5zYWN0aW9uLnJlYWRfc2VtYSk7CisJbWlzY19kZXJlZ2lzdGVyKCZmY29weV9taXNjKTsKK30KKworaW50IGh2X2Zjb3B5X2luaXQoc3RydWN0IGh2X3V0aWxfc2VydmljZSAqc3J2KQoreworCXJlY3ZfYnVmZmVyID0gc3J2LT5yZWN2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AgICAgICAgICAgICAgICAweDA4Ci0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVFNfR1lST19PVVQgICAgICAgICAgICAgICAgICAgMHg3MAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfQUNDRUxfT1VUICAgICAgICAgICAweDA4CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVFNfR1lST19PVVQgICAgICAgICAgIDB4NzAKIAogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfSU5UX0VOQUJMRSAgICAgICAgICAweDM4Ci0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9EQVRBX1JEWV9FTiAgICAgICAgICAgICAgICAgMHgwMQotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0lOVF9FTiAgICAgICAgICAgICAgICAgIDB4MDIKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0RBVEFfUkRZX0VOICAgICAgICAgMHgwMQorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0lOVF9FTiAgICAgICAgICAweDAyCiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1JBV19BQ0NFTCAgICAgICAgICAgMHgzQgogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfVEVNUEVSQVRVUkUgICAgICAgICAweDQxCiAjZGVmaW5lIElOVl9NUFU2MDUwX1JFR19SQVdfR1lSTyAgICAgICAgICAgIDB4NDMKIAogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfVVNFUl9DVFJMICAgICAgICAgICAweDZBCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX1JTVCAgICAgICAgICAgICAgICAgICAgMHgwNAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX1JTVCAgICAgICAgICAgICAgICAgICAgIDB4MDgKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0kyQ19NU1RfRU4gICAgICAgICAgICAgICAgICAweDIwCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX0VOICAgICAgICAgICAgICAgICAgICAgMHg0MAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0VOICAgICAgICAgICAgICAgICAgICAgIDB4ODAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0ZJRk9fUlNUICAgICAgICAgICAgMHgwNAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX1JTVCAgICAgICAgICAgICAweDA4CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9JMkNfTVNUX0VOICAgICAgICAgIDB4MjAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0ZJRk9fRU4gICAgICAgICAgICAgMHg0MAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0VOICAgICAgICAgICAgICAweDgwCiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1BXUl9NR01UXzEgICAgICAgICAgMHg2QgotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfSF9SRVNFVCAgICAgICAgICAgICAgICAgICAgIDB4ODAKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1NMRUVQICAgICAgICAgICAgICAgICAgICAgICAweDQwCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9DTEtfTUFTSyAgICAgICAgICAgICAgICAgICAgMHg3CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9IX1JFU0VUICAgICAgICAgICAgIDB4ODAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1NMRUVQICAgICAgICAgICAgICAgMHg0MAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfQ0xLX01BU0sgICAgICAgICAgICAweDcKIAogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfUFdSX01HTVRfMiAgICAgICAgICAweDZDCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9QV1JfQUNDTF9TVEJZICAgICAgICAgICAgICAgMHgzOAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfUFdSX0dZUk9fU1RCWSAgICAgICAgICAgICAgIDB4MDcKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1BXUl9BQ0NMX1NUQlkgICAgICAgMHgzOAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfUFdSX0dZUk9fU1RCWSAgICAgICAweDA3CiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX0ZJRk9fQ09VTlRfSCAgICAgICAgMHg3MgogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfRklGT19SX1cgICAgICAgICAgICAweDc0CkBAIC0xODAsMTAgKzE4MCwxMCBAQAogCiAvKiBpbml0IHBhcmFtZXRlcnMgKi8KICNkZWZpbmUgSU5WX01QVTYwNTBfSU5JVF9GSUZPX1JBVEUgICAgICAgICAgIDUwCi0jZGVmaW5lIElOVl9NUFU2MDUwX1RJTUVfU1RBTVBfVE9SICAgICAgICAgICAgICAgICAgICAgICAgNQotI2RlZmluZSBJTlZfTVBVNjA1MF9NQVhfRklGT19SQVRFICAgICAgICAgICAgICAgICAgICAgICAgIDEwMDAKLSNkZWZpbmUgSU5WX01QVTYwNTBfTUlOX0ZJRk9fUkFURSAgICAgICAgICAgICAgICAgICAgICAgICA0Ci0jZGVmaW5lIElOVl9NUFU2MDUwX09ORV9LX0haICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBJTlZfTVBVNjA1MF9USU1FX1NUQU1QX1RPUiAgICAgICAgICAgNQorI2RlZmluZSBJTlZfTVBVNjA1MF9NQVhfRklGT19SQVRFICAgICAgICAgICAgMTAwMAorI2RlZmluZSBJTlZfTVBVNjA1MF9NSU5fRklGT19SQVRFICAgICAgICAgICAgNAorI2RlZmluZSBJTlZfTVBVNjA1MF9PTkVfS19IWiAgICAgICAgICAgICAgICAgMTAwMAogCiAvKiBzY2FuIGVsZW1lbnQgZGVmaW5pdGlvbiAqLwogZW51bSBpbnZfbXB1NjA1MF9zY2FuIHsKZGlmZiAtLWdpdCB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NTAxX0FMU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+YWxzX2NvbnRyID0gcmV0IHwgTFRSNTAxX0NPTlRSX0FDVElWRTsKKworCXJldCA9IGkyY19zbWJ1c19yZWFkX2J5dGVfZGF0YShkYXRhLT5jbGllbnQsIExUUjUwMV9QU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+cHNfY29udHIgPSByZXQgfCBMVFI1MDFfQ09OVFJfQUNUSVZFOworCisJcmV0dXJuIGx0cjUwMV93cml0ZV9jb250cihkYXRhLT5jbGllbnQsIGRhdGEtPmFsc19jb250ciwKKwkJZGF0YS0+cHNfY29udHIpOworfQorCitzdGF0aWMgaW50IGx0cjUwMV9wcm9iZShzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LAorCQkJICBjb25zdCBzdHJ1Y3QgaTJjX2RldmljZV9pZCAqaWQpCit7CisJc3RydWN0IGx0cjUwMV9kYXRhICpkYXRhOworCXN0cnVjdCBpaW9fZGV2ICppbmRpb19kZXY7CisJaW50IHJldDsKKworCWluZGlvX2RldiA9IGRldm1faWlvX2RldmljZV9hbGxvYygmY2xpZW50LT5kZXYsIHNpemVvZigqZGF0YSkpOworCWlmICghaW5kaW9fZGV2KQorCQlyZXR1cm4gLUVOT01FTTsKKworCWRhdGEgPSBpaW9fcHJpdihpbmRpb19kZXYpOworCWkyY19zZXRfY2xpZW50ZGF0YShjbGllbnQsIGluZGlvX2Rldik7CisJZGF0YS0+Y2xpZW50ID0gY2xpZW50OworCW11dGV4X2luaXQoJmRhdGEtPmxvY2tfYWxzKTsKKwltdXRleF9pbml0KCZkYXRhLT5sb2NrX3BzKTsKKworCXJldCA9IGkyY19zbWJ1c19yZWFkX2J5dGVfZGF0YShkYXRhLT5jbGllbnQsIExUUjUwMV9QQVJUX0lEKTsKKwlpZiAocmV0IDwgMCkKKwkJcmV0dXJuIHJldDsKKwlpZiAoKHJld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8gc2V0dXAtaXJxLm8KLW9iai0kKENPTkZJR19BUk0pICs9IHNldHVwLWJ1cy5vIHNldHVwLWlycS5vCi1vYmotJChDT05GSUdfVU5JQ09SRTMyKSArPSBzZXR1cC1idXMubyBzZXR1cC1pcnEubwotb2JqLSQoQ09ORklHX1BBUklTQykgKz0gc2V0dXAtYnVzLm8KLW9iai0kKENPTkZJR19TVVBFUkgpICs9IHNldHVwLWJ1cy5vIHNldHVwLWlycS5vCi1vYmotJChDT05GSUdfUFBDKSArPSBzZXR1cC1idXMubwotb2JqLSQoQ09ORklHX0ZSVikgKz0gc2V0dXAtYnVzLm8KLW9iai0kKENPTkZJR19NSVBTKSArPSBzZXR1cC1idXMubyBzZXR1cC1pcnEubwotb2JqLSQoQ09ORklHX1g4Nl9WSVNXUykgKz0gc2V0dXAtaXJxLm8KLW9iai0kKENPTkZJR19NTjEwMzAwKSArPSBzZXR1cC1idXMubwotb2JqLSQoQ09ORklHX01JQ1JPQkxBWkUpICs9IHNldHVwLWJ1cy5vCi1vYmotJChDT05GSUdfVElMRSkgKz0gc2V0dXAtYnVzLm8gc2V0dXAtaXJxLm8KLW9iai0kKENPTkZJR19TUEFSQ19MRU9OKSArPSBzZXR1cC1idXMubyBzZXR1cC1pcnEubwotb2JqLSQoQ09ORklHX002OEspICs9IHNldHVwLWJ1cy5vIHNldHVwLWlycS5vCitvYmotJChDT05GSUdfQUxQSEEpICs9IHNldHVwLWlycS5vCitvYmotJChDT05GSUdfQVJNKSArPSBzZXR1cC1pcnEubworb2JqLSQoQ09ORklHX1VOSUNPUkUzMikgKz0gc2V0dXAtaXJxLm8KK29iai0kKENPTkZJR19TVVBFUkgpICs9IHNldHVwLWlycS5vCitvYmotJChDT05GSUdfTUlQUykgKz0gc2V0dXAtaXJxLm8KK29iai0kKENPTkZJR19USUxFKSArPSBzZXR1cC1pcnEubworb2JqLSQoQ09ORklHX1NQQVJDX0xFT04pICs9IHNldHVwLWlycS5vCitvYmotJChDT05GSUdfTTY4S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ZGV2LCAiTm8gRFBMTCBjb25maWd1cmF0aW9uIGZvciAlbHUgSHogU1lTIENMS1xuIiwgcmF0ZSk7CisKKwlyZXR1cm4gTlVMTDsKK30KKworc3RhdGljIGludCB0aV9waXBlM19wb3dlcl9vZmYoc3RydWN0IHBoeSAqeCkKK3sKKwlzdHJ1Y3QgdGlfcGlwZTMgKnBoeSA9IHBoeV9nZXRfZHJ2ZGF0YSh4KTsKKworCW9tYXBfY29udHJvbF9waHlfcG93ZXIocGh5LT5jb250cm9sX2RldiwgMCk7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCB0aV9waXBlM19wb3dlcl9vbihzdHJ1Y3QgcGh5ICp4KQoreworCXN0cnVjdCB0aV9waXBlMyAqcGh5ID0gcGh5X2dldF9kcnZkYXRhKHgpOworCisJb21hcF9jb250cm9sX3BoeV9wb3dlcihwaHktPmNvbnRyb2xfZGV2LCAxKTsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHRpX3BpcGUzX2RwbGxfd2FpdF9sb2NrKHN0cnVjdCB0aV9waXBlMyAqcGh5KQoreworCXUzMgkJdmFsOworCXVuc2lnbmVkIGxvbmcJdGltZW91dDsKKworCXRpbWVvdXQgPSBqaWZmaWVzICsgbXNlY3NfdG9famlmZmllcyhQTExfTE9DS19USU1FKTsKKwlkbyB7CisJCWNwdV9yZWxheCgpOworCQl2YWwgPSB0aV9waXBlM19yZWFkbChwaHktPnBsbF9jdHJsX2Jhc2UsIFBMTF9TVEFUVVMpOworCQlpZiAodmFsICYgUExMX0xPQ0spCisJCQlicmVhazsKKwl9IHdoaWxlICghdGltZV9hZnRlcihqaWZmaWVzLCB0aW1lb3V0KSk7CisKKwlpZiAoISh2YWwgJiBQTExfTE9DSykpIHsKKwkJZGV2X2VycihwaHktPmRldiwgIkRQTEwgZmFpbGVkIHRvIGxvY2tcbiIpOworCQlyZXR1cm4gLUVCVVNZOworCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHRpX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KKworCQlwaHktPndrdXBjbGsgPSBkZXZtX2Nsa19nZXQocGh5LT5kZXYsICJ3a3VwY2xrIik7CisJCWlmIChJU19FUlIocGh5LT53a3VwY2xrKSkgeworCQkJZGV2X2VycigmcGRldi0+ZGV2LCAidW5hYmxlIHRvIGdldCB3a3VwY2xrXG4iKTsKKwkJCXJldHVybiBQVFJfRVJSKHBoeS0+d2t1cGNsayk7CisJCX0KKworCQlwaHktPnJlZmNsayA9IGRldm1fY2xrX2dldChwaHktPmRldiwgInJlZmNsayIpOworCQlpZiAoSVNfRVJSKHBoeS0+cmVmY2xrKSkgeworCQkJZGV2X2VycigmcGRldi0+ZGV2LCAidW5hYmxlIHRvIGdldCByZWZjbGtcbiIpOworCQkJcmV0dXJuIFBUUl9FUlIocGh5LT5yZWZjbGspOworCQl9CisJfSBlbHNlIHsKKwkJcGh5LT53a3VwY2xrID0gRVJSX1BUUigtRU5PREVWKTsKKwkJcGh5LT5yZWZjbGsgPSBFUlJfUFRSKC1FTk9ERVYpOworCX0KKworCXBoeS0+c3lzX2NsayA9IGRldm1fY2xrX2dldChwaHktPmRldiwgInN5c2NsayIpOworCWlmIChJU19FUlIocGh5LT5zeXNfY2xrKSkgeworCQlkZXZfZXJyKCZwZGV2LT5kZXYsICJ1bmFibGUgdG8gZ2V0IHN5c2Nsa1xuIik7CisJCXJldHVybiAtRUlOVkFMOworCX0KKworCWNvbnRyb2xfbm9kZSA9IG9mX3BhcnNlX3BoYW5kbGUobm9kZSwgImN0cmwtbW9kdWxlIiwgMCk7CisJaWYgKCFjb250cm9sX25vZGUpIHsKKwkJZGV2X2VycigmcGRldi0+ZGV2LCAiRmFpbGVkIHRvIGdldCBjb250cm9sIGRldmljZSBwaGFuZGxlXG4iKTsKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJY29udHJvbF9wZGV2ID0gb2ZfZmluZF9kZXZpY2VfYnlfbm9kZShjb250cm9sX25vZGUpOworCWlmICghY29udHJvbF9wZGV2KSB7CisJCW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3RydWN0IGRldmljZSAqZGV2KQoreworCXN0cnVjdCB0aV9waXBlMwkqcGh5ID0gZGV2X2dldF9kcnZkYXRhKGRldik7CisKKwlpZiAoIUlTX0VSUihwaHktPndrdXBjbGspKQorCQljbGtfZGlzYWJsZV91bnByZXBhcmUocGh5LT53a3VwY2xrKTsKKwlpZiAoIUlTX0VSUihwaHktPnJlZmNsaykpCisJCWNsa19kaXNhYmxlX3VucHJlcGFyZShwaHktPnJlZmNsayk7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCB0aV9waXBlM19ydW50aW1lX3Jlc3VtZShzdHJ1Y3QgZGV2aWNlICpkZXYpCit7CisJdTMyIHJldCA9IDA7CisJc3RydWN0IHRpX3BpcGUzCSpwaHkgPSBkZXZfZ2V0X2RydmRhdGEoZGV2KTsKKworCWlmICghSVNfRVJSKHBoeS0+cmVmY2xrKSkgeworCQlyZXQgPSBjbGtfcHJlcGFyZV9lbmFibGUocGh5LT5yZWZjbGspOworCQlpZiAocmV0KSB7CisJCQlkZXZfZXJyKHBoeS0+ZGV2LCAiRmFpbGVkIHRvIGVuYWJsZSByZWZjbGsgJWRcbiIsIHJldCk7CisJCQlnb3RvIGVycjE7CisJCX0KKwl9CisKKwlpZiAoIUlTX0VSUihwaHktPndrdXBjbGspKSB7CisJCXJldCA9IGNsa19wcmVwYXJlX2VuYWJsZShwaHktPndrdXBjbGspOworCQlpZiAocmV0KSB7CisJCQlkZXZfZXJyKHBoeS0+ZGV2LCAiRmFpbGVkIHRvIGVuYWJsZSB3a3VwY2xrICVkXG4iLCByZXQpOworCQkJZ290byBlcnIyOworCQl9CisJfQorCisJcmV0dXJuIDA7CisKK2VycjI6CisJaWYgKCFJU19FUlIocGh5LT5yZWZjbGspKQorCQljbGtfZGlzYWJsZV91bnByZXBhcmUocGh5LT5yZWZjbGspOworCitlcnIxOgorCXJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZGV2X3BtX29wcyB0aV9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lcCiAJCS5kcnZ0eXBlX2JhbmsgPSAwLAkJCQkJXAogCQkuZHJ2dHlwZV9iaXQgPSA2LAkJCQkJXAogCX0KIAogc3RhdGljIGNvbnN0IHN0cnVjdCB0ZWdyYV9waW5ncm91cCB0ZWdyYTExNF9ncm91cHNbXSA9IHsKIAkvKiAgICAgICBwZ19uYW1lLCAgICAgICAgICAgICAgICBmMCwgICAgICAgICBmMSwgICAgICAgICBmMiwgICAgICAgICAgIGYzLCAgICAgICAgICBzYWZlLCAgICAgciwgICAgICBvZCwgaW9yLCByY3Zfc2VsICovCi0JLyogRklYTUU6IEZpbGwgaW4gY29ycmVjdCBkYXRhIGluIHNhZmUgY29sdW1uICovCiAJUElOR1JPVVAodWxwaV9kYXRhMF9wbzEsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwMCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMV9wbzIsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwNCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMl9wbzMsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwOCwgIE4sICBOLCAgTiksCkBAIC0yNjM1LDYgKzE3NDEsNyBAQAogCVBJTkdST1VQKHBiYjYsICAgICAgICAgICAgICAgICAgIFZHUDYsICAgICAgIERJU1BMQVlBLCAgIERJU1BMQVlCLCAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYTQsICBOLCAgTiwgIE4pLAogCVBJTkdST1VQKHBiYjcsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgIC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JTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzI4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChwd3JfaW50X24sICAgICAgICAgICAgICBQTUksICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzJjLCAgTiwgIE4sICBOKSwKKwlQSU5HUk9VUChjbGtfMzJrX2luLCAgICAgICAgICAgICBDTEssICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBDTEssICAgICAgMHgzMzMwLCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChvd3IsICAgICAgICAgICAgICAgICAgICBPV1IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM0LCAgTiwgIE4sICBZKSwKIAlQSU5HUk9VUChkYXAxX2ZzX3BuMCwgICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChkYXAxX2Rpbl9wbjEsICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzNjLCAgTiwgIE4sICBOKSwKQEAgLTI2OTcsMzggKzE4MDUsNDggQEAKIAlQSU5HUk9VUCh1c2JfdmJ1c19lbjFfcG41LCAgICAgICBVU0IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzM2Y4LCAgWSwgIE4sICBOKSwKIAlQSU5HUk9VUChzZG1tYzNfY2xrX2xiX2luX3BlZTUsICBTRE1NQzMsICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAg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UksICAgICAgICAgUlNWRDMsICAgICAgMHgzMTljLCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTAsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKGdlbjFfaTJjX3NkYV9wYzUsICAgICAgIEkyQzEsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIEkyQzEsICAgICAgIDB4MzFhNCwgIFksICBOLCAgTiksCisgICAgICAgUElOR1JPVVAoZ2VuMV9pMmNfc2RhX3BjNSwgICAgICAgSTJDMSwgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJDMSwgICAgICAgMHgzMWEwLCAgWSwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTQsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGRhcDRfZnNfcHA0LCAgICAgICAgICAgIEkyUzMsICAgICAgIEdNSSwgICAgICAgIERUViwgICAgICAgICAgUlNWRDQsICAgICAgIEkyUzMsICAgICAgIDB4MzFhOCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAoZGFwNF9kaW5fcHA1LCAgICAgICAgICAgSTJTMywgICAgICAgR01JLCAgICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJTMywgICAgICAgMHgzMWFjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChkYXA0X2RvdXRfcHA2LCAgICAgICAgICBJMlMzLCAgICAgICBHTUksICAgICAgICBEVFYsICAgICAgICAgIFJTVkQ0LCAgICAgICBJMlMzLCAgICAgICAweDMxYjAsICBOLCAgTiwgIE4pLApAQCAtMjk2NCw5ICsxODU5LDkgQEAKICAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0NF9wYWE0LCAgICAgICBTRE1NQzQsICAgICBTUEkzLCAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyNzAsICBOLCAgWSwgIE4pLAogICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ1X3BhYTUsICAgICAgIFNETU1DNCwgICAgIFNQSTMsICAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3NCwgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoc2RtbWM0X2RhdDZfcGFhNiwgICAgICAgU0RNTUM0LCAgICAgU1BJMywgICAgICAgR01JLCAgICAgICAgICBSU1ZENCwgICAgICAgU0RNTUM0LCAgICAgMHgzMjc4LCAgTiwgIFksICBOKSwKLSAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0N19wYWE3LCAgICAgICBTRE1NQzQsICAgICBSU1ZEMSwgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyN2MsICBOLCAgWSwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ3X3BhYTcsICAgICAgIFNETU1DNCwgICAgIFJTVkQyLCAgICAgIEdNSSwgICAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3YywgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoY2FtX21jbGtfcGNjMCwgICAgICAgICAgVkksICAgICAgICAgVklfQUxUMSwgICAgVklfQUxUMywgICAgICBTRE1NQzIsICAgICAgVkksICAgICAgICAgMHgzMjg0LCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChwY2MxLCAgICAgICAgICAgICAgICAgICBJMlM0LCAgICAgICBSU1ZEMSwgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBJMlM0LCAgICAgICAweDMyODgsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHBjYzEsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIEkyUzQsICAgICAgIDB4MzI4OCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAocGJiMCwgICAgICAgICAgICAgICAgICAgVkdQNiwgICAgICAgVklNQ0xLMiwgICAgU0RNTUMyLCAgICAgICBWSU1DTEsyX0FMVCwgVkdQNiwgICAgICAgMHgzMjhjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChjYW1faTJjX3NjbF9wYmIxLCAgICAgICBWR1AxLCAgICAgICBJMkMzLCAgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBWR1AxLCAgICAgICAweDMyOTAsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGNhbV9pMmNfc2RhX3BiYjIsICAgICAgIFZHUDIsICAgICAgIEkyQzMsICAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIFZHUDIsICAgICAgIDB4MzI5NCwgIFksICBOLCAgTiksCkBAIC0zMDQ3LDggKzE5NDIsOCBAQAogICAgICAgIFBJTkdST1VQKGdwaW9fdzNfYXVkX3B3MywgICAgICAgIFNQSTYsICAgICAgIFNQSTEsICAgICAgIFNQSTIsICAgICAgICAgSTJDMSwgICAgICAgIFNQSTEsICAgICAgIDB4MzNmMCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAodXNiX3ZidXNfZW4wX3BuNCwgICAgICAgVVNCLCAgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgVVNCLCAgICAgICAgMHgzM2Y0LCAgWSwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUCh1c2JfdmJ1c19lbjFfcG41LCAgICAgICBVU0IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBVU0IsICAgICAgICAweDMzZjgsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzNmYywgIE4sICBOLCAgTiksCi0gICAgICAgUElOR1JPVVAoc2RtbWMzX2Nsa19sYl9pbl9wZWU1LCAgU0RNTUMzLCAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgU0RNTUMzLCAgICAgMHgzNDAwLCAgTiwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChzZG1tYzNfY2xrX2xiX2luX3BlZTUsICBTRE1NQzMsICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzMsICAgICAweDMzZmMsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzQwMCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAoZ21pX2Nsa19sYiwgICAgICAgICAgICAgU0RNTUMyLCAgICAgUlNWRDIsICAgICAgR01JLCAgICAgICAgICBSU1ZENCwgICAgICAgU0RNTUMyLCAgICAgMHgzNDA0LCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChyZXNldF9vdXRfbiwgICAgICAgICAgICBSU1ZEMSwgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJFU0VUX09VVF9OLCBSU1ZEMSwgICAgICAweDM0MDgsICBOL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c3luY19jX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oNSwgMjUpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3N5bmNfY19tdXhbXSA9IHsKKwlNU0lPRjBfU1lOQ19DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjBfc3MxX2NfcGluc1tdID0geworCS8qIFNTMSAqLworCVJDQVJfR1BfUElOKDUsIDI3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zczFfY19tdXhbXSA9IHsKKwlNU0lPRjBfU1MxX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9zczJfY19waW5zW10gPSB7CisJLyogU1MyICovCisJUkNBUl9HUF9QSU4oNSwgMjgpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3NzMl9jX211eFtdID0geworCU1TSU9GMF9TUzJfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3J4X2NfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDUsIDI5KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF9yeF9jX211eFtdID0geworCU1TSU9GMF9SWERfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YwX3R4X2NfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDUsIDMwKSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMF90eF9jX211eFtdID0geworCU1TSU9GMF9UWERfQ19NQVJLLAorfTsKIC8qIC0gTVNJT0YxIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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nQgbXNpb2YxX3R4X2NfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDIsIDE3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9jX211eFtdID0geworCU1TSU9GMV9UWERfQ19NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2RfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDAsIDI4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfZF9tdXhbXSA9IHsKKwlNU0lPRjFfU0NLX0RfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zeW5jX2RfcGluc1tdID0geworCS8qIFNZTkMgKi8KKwlSQ0FSX0dQX1BJTigwLCAzMCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19kX211eFtdID0geworCU1TSU9GMV9TWU5DX0RfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfZF9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oMCwgMjkpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMV9kX211eFtdID0geworCU1TSU9GMV9TUzFfRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4X2RfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDAsIDI3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9kX211eFtdID0geworCU1TSU9GMV9SWERfRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4X2RfcGluc1tdID0geworCS8qIFRYRCAqLwor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nN0IHVuc2lnbmVkIGludCBtc2lvZjJfcnhfYl9waW5zW10gPSB7CisJLyogUlhEICovCisJUkNBUl9HUF9QSU4oMywgMTcpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3J4X2JfbXV4W10gPSB7CisJTVNJT0YyX1JYRF9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfdHhfYl9waW5zW10gPSB7CisJLyogVFhEICovCisJUkNBUl9HUF9QSU4oMywgMTYpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2JfbXV4W10gPSB7CisJTVNJT0YyX1RYRF9CX01BUkssCit9OworCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfY19waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oMiwgMiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2NfbXV4W10gPSB7CisJTVNJT0YyX1NDS19DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19jX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMiwgMyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19jX211eFtdID0geworCU1TSU9GMl9TWU5DX0NfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9yeF9jX3BpbnNbXSA9IHsKKwkvKiBSWEQgKi8KKwlSQ0FSX0dQX1BJTigyLCA1KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9yeF9jX211eFtdID0geworCU1TSU9GMl9SWERfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2NfcGluc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ICAgICAgICAgICB8IDB4MTE1NS0weDExNTggIHwKLSAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTAxOC0weDEwMTkgIHwKKyAqIHwgTW9kdWxlIEluaXQgYW5kIFByb2JlICAgICAgICB8ICAgICAgIDB4MDE3ZCAgICAgICB8IDB4MDA0YiwweDAxNDEJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgwMTQ0LDB4MDE0Ngl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDAxNWItMHgwMTYwCXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MDE2ZS0weDAxNzAJfAorICogfCBNYWlsYm94IGNvbW1hbmRzICAgICAgICAgICAgIHwgICAgICAgMHgxMTg3ICAgICAgIHwgMHgxMDE4LTB4MTAxOQl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDEwY2EgICAgICAgICB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDExMTUtMHgxMTE2ICB8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDEwY2EJCXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4MTExYS0weDExMWIJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgxMTU1LTB4MTE1OCAgfAogICogfCBEZXZpY2UgRGlzY292ZXJ5ICAgICAgICAgICAgIHwgICAgICAgMHgyMDk1ICAgICAgIHwgMHgyMDIwLTB4MjAyMiwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgyMDExLTB4MjAxMiwgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHgyMDE2ICAgICAgICAgfApAQCAtMzIsMTggKzM0LDE3IEBACiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDUwNDcsMHg1MDUyICB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDUwODQsMHg1MDc1CXwKICAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTAzZCwweDUwNDQgIHwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4NTA3YgkJfAogICogfCBUaW1lciBSb3V0aW5lcyAgICAgICAgICAgICAgIHwgICAgICAgMHg2MDEyICAgICAgIHwgICAgICAgICAgICAgICAgfAotICogfCBVc2VyIFNwYWNlIEludGVyYWN0aW9ucyAgICAgIHwgICAgICAgMHg3MGUxICAgICAgIHwgMHg3MDE4LDB4NzAyZSwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDIwLDB4NzAyNCwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDM5LDB4NzA0NSwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDczLTB4NzA3NSwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDdiLDB4NzA4YywgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGE1LDB4NzBhNiwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGE4LDB4NzBhYiwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGFkLTB4NzBhZSwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGQxLTB4NzBkYiwgfAotICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDQ3LDB4NzAzYgl8Ci0gKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweDcwZGUtMHg3MGRmLCB8CisgKiB8IFVzZXIgU3BhY2UgSW50ZXJhY3Rpb25zICAgICAgfCAgICAgICAweDcwZTIgICAgICAgfCAweDcwMTgsMHg3MDJlICB8CisgKiB8CQkJCSAgfAkJICAgICAgIHwgMHg3MDIwLDB4NzAyNCAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDM5LDB4NzA0NSAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MDczLTB4NzA3NSAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGE1LTB4NzBhNiAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGE4LDB4NzBhYiAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGFkLTB4NzBhZSAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGQ3LTB4NzBkYiAgfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg3MGRlLTB4NzBkZiAgfAogICogfCBUYXNrIE1hbmFnZW1lbnQgICAgICAgICAgICAgIHwgICAgICAgMHg4MDNkICAgICAgIHwgMHg4MDI1LTB4ODAyNiAgfAogICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgIHwgMHg4MDBiLDB4ODAzOSAgfAogICogfCBBRVIvRUVIICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgMHg5MDExICAgICAgIHwJCXwKQEAgLTU5LDcgKzYwLDExIEBACiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweGIxM2MtMHhiMTQwICB8CiAgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweGIxNDkJCXwKICAqIHwgTXVsdGlRICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIDB4YzAwYyAgICAgICB8CQl8Ci0gKiB8IE1pc2MgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAweGQwMTAgICAgICAgfAkJfAorICogfCBNaXNjICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgMHhkMmZmICAgICAgIHwgMHhkMDE3LTB4ZDAxOQl8CisgKiB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgfCAweGQwMjAJCXwKKyAqIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICB8IDB4ZDAyZS0weGQwZmYJfAorICogfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAg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mZmVyOworCQkJLyogb2Zmc2V0cyBmcm9tIGJ1ZmZlciB0byBmbGF0X2JpbmRlcl9vYmplY3Qgc3RydWN0cyAqLworCQkJYmluZGVyX3VpbnRwdHJfdAlvZmZzZXRzOworCQl9IHB0cjsKKwkJX191OAlidWZbOF07CisJfSBkYXRhOworfTsKKworc3RydWN0IGJpbmRlcl9wdHJfY29va2llIHsKKwliaW5kZXJfdWludHB0cl90IHB0cjsKKwliaW5kZXJfdWludHB0cl90IGNvb2tpZTsKK307CisKK3N0cnVjdCBiaW5kZXJfaGFuZGxlX2Nvb2tpZSB7CisJX191MzIgaGFuZGxlOworCWJpbmRlcl91aW50cHRyX3QgY29va2llOworfSBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKworc3RydWN0IGJpbmRlcl9wcmlfZGVzYyB7CisJX19zMzIgcHJpb3JpdHk7CisJX191MzIgZGVzYzsKK307CisKK3N0cnVjdCBiaW5kZXJfcHJpX3B0cl9jb29raWUgeworCV9fczMyIHByaW9yaXR5OworCWJpbmRlcl91aW50cHRyX3QgcHRyOworCWJpbmRlcl91aW50cHRyX3QgY29va2llOworfTsKKworZW51bSBiaW5kZXJfZHJpdmVyX3JldHVybl9wcm90b2NvbCB7CisJQlJfRVJST1IgPSBfSU9SKCdyJywgMCwgX19zMzIpLAorCS8qCisJICogaW50OiBlcnJvciBjb2RlCisJICovCisKKwlCUl9PSyA9IF9JTygncicsIDEpLAorCS8qIE5vIHBhcmFtZXRlcnMhICovCisKKwlCUl9UUkFOU0FDVElPTiA9IF9JT1IoJ3InLCAyLCBzdHJ1Y3QgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEpLAorCUJSX1JFUExZID0gX0lPUigncicsIDMsIHN0cnVjdCBiaW5kZXJfdHJhbnNhY3Rpb25fZGF0YSksCisJLyoKKwkgKiBiaW5kZXJfdHJhbnNhY3Rpb25fZGF0YTogdGhlIHJlY2VpdmVkIGNvbW1hbmQuCisJICovCisKKwlCUl9BQ1FVSVJ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hSGFuZDE0MDFbaGFuZF0sKHVuc2lnbmVkIGludClVMTRfU0VUVFJBTlNGRVIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkLHNpemVvZihUUkFOU0ZFUkRFU0MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZCxzaXplb2Yoc3RydWN0IHRyYW5zZmVyX2FyZWFfZGVzYyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJXb3JrLHNpemVvZihQQVJBTUJMSyksJmR3Qnl0ZXMsTlVMTCkpCiAgICAgICAgIHsKICAgICAgICAgICAgIGlmIChkd0J5dGVzID49IHNpemVvZihQQVJBTUJMSykpICAgIC8vIG1heWJlIGVycm9yIGZyb20gZHJpdmVyPwpAQCAtMjQ5NiwxNCArMjQ5NiwxNCBAQAogICAgIHsKICAgICAgICAgUEFSQU1CTEsgcldvcms7CiAgICAgICAgIHVuc2lnbmVkIGludCBkd0J5dGVzOwotICAgICAgICBUUkFOU0ZFUkRFU0MgdHhEZXNjOworICAgICAgICBzdHJ1Y3QgdHJhbnNmZXJfYXJlYV9kZXNjIHR4RGVzYzsKICAgICAgICAgdHhEZXNjLndBcmVhID0gd0FyZWE7ICAgICAgICAgICAgIC8qIFB1cmUgTlQgLSBwdXQgZGF0YSBpbnRvIHN0cnVjdCAqLwogICAgICAgICB0eERlc2MubHB2QnVmZiA9IHB2QnVmZjsKICAgICAgICAgdHhEZXNjLmR3TGVuZ3RoID0gZHdMZW5ndGg7CiAgICAgICAgIHR4RGVzYy5lU2l6ZSA9IChzaG9ydCliVG9Ib3N0OyAgICAgICAvKiBVc2UgdGhpcyBmb3IgZGlyZWN0aW9uIGZsYWcgKi8KICAgIAogICAgICAgICBpZiAoRGV2aWNlSW9Db250cm9sKGFIYW5kMTQwMVtoYW5kXSwodW5zaWduZWQgaW50KVUxNF9TRVRDSVJDVUxBUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0eERlc2MsIHNpemVvZihUUkFOU0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gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLworICogQ29weXJpZ2h0IChDKSAyMDA0LDIwMDUgIEFEREktREFUQSBHbWJIIGZvciB0aGUgc291cmNlIGNvZGUgb2YgdGhpcyBtb2R1bGUuCisgKgorICoJQURESS1EQVRBIEdtYkgKKyAqCURpZXNlbHN0cmFzc2UgMworICoJRC03NzgzMyBPdHRlcnN3ZWllcgorICoJVGVsOiArMTkoMCk3MjIzLzk0OT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XRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gICAgICAgICAgICA6IDAgQ29uZmlndXJlIEFzIFRpbWVyICAgICAgfAotfAkJCQkJCQkJCQkgICAxIENvbmZpZ3VyZSBBcyBXYXRjaGRvZyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IFdhdGNoZG9nIG51bWJlcgotfAkJCQkJICBkYXRhWzJdICAgICAgICAgICAgOiBUaW1lIGJhc2UgVW5pdCAgICAgICAgICAgIHwKLXwJCQkJCSAgZGF0YVszXQkJCSA6IFJlbG9hZCBWYWx1ZQkJCSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSAgICAgICAgICAgIDogRXh0ZXJuYWwgVHJpZ2dlciAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOkVuYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDpEaXNhYmxlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs1XSAgICAgICAgICAgIDpFeHRlcm5hbCBUcmlnZ2VyIExldmVsCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMCBUcmlnZ2VyIERpc2FibGVkCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMSBUcmlnZ2VyIEVuYWJsZWQgKExvdyBsZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwIFRyaWdnZXIgRW5hYmxlZCAoSGlnaCBMZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExIFRyaWdnZXIgRW5hYmxlZCAoSGlnaC9Mb3cgbGV2ZWwpCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs2XSAgICAgICAgICAgIDogRXh0ZXJuYWwgR2F0ZSAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOkVuYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA6RGlzYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbN10gICAgICAgICAgICA6IEV4dGVybmFsIEdhdGUgbGV2ZWwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAwIEdhdGUgRGlzYWJsZWQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAxIEdhdGUgRW5hYmxlZCAoTG93IGxldmVsKQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAgR2F0ZSBFbmFibGVkIChIaWdoIExldmVsKQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbOF0gICAgICAgICAgICA6V2FybmluZyBSZWxheQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwOiBESVNBQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs5XSAgICAgICAgICAgIDpXYXJuaW5nIERlbGF5IGF2YWlsYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMTBdICAgICAgICAgICA6V2FybmluZyBSZWxheSBUaW1lIHVuaXQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzExXSAgICAgICAgICAgOldhcm5pbmcgUmVsYXkgVGltZSBSZWxvYWQgdmFsdWUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzEyXSAgICAgICAgICAgOlJlc2V0IFJlbGF5Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogRElTQUJMRQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMTNdICAgICAgICAgICA6SW50ZXJydXB0Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogRElTQUJMRQotfAotfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IFRSVUUgIDogTm8gZXJyb3Igb2NjdXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICA6IEZBTFNFIDogRXJyb3Igb2NjdXIuIFJldHVybiB0aGUgZXJyb3IgICAgICAgICAgfAotfAkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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AgICAgICAgICAgKi8KIAkJLyogLSBEaXNhYmxlIHRoZSBoYXJkd2FyZSAgICAgKi8KIAkJLyogLSBEaXNhYmxlIHRoZSBjb3VudGVyIG1vZGUgKi8KQEAgLTIwNiwxMDEgKzE1MSw4MiBAQAogCQkvKiAtIERpc2FibGUgdGhlIHJlc2V0ICAgICAgICAqLwogCQkvKiAtIEVuYWJsZSB0aGUgdGltZXIgbW9kZSAgICAqLwogCQkvKiAtIFNldCB0aGUgdGltZXIgbW9kZSAgICAgICAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQl1aV9Db21tYW5kID0KIAkJCSh1aV9Db21tYW5kICYgMHhGRkY3MTlFMlVMKSB8IHVpX01vZGUgPDwgMTNVTCB8IDB4MTBVTDsKIAotCX0JCQkvKiBpZiAoZGF0YVswXSA9PSBBRERJREFUQV9USU1FUikgKi8KLQllbHNlIHsKLQkJaWYgKGRhdGFbMF0gPT0gQURESURBVEFfV0FUQ0hET0cpIHsKKwl9IGVsc2UgaWYgKGRhdGFbMF0gPT0gQURESURBVEFfV0FUQ0hET0cpIHsKIAotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFNldCB0aGUgbW9kZSA6ICAgICAgICAgICAgICovCi0JCQkvKiAtIERpc2FibGUgdGhlIGhhcmR3YXJlICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSBjb3VudGVyIG1vZGUgKi8KLQkJCS8qIC0gRGlzYWJsZSB0aGUgd2FybmluZyAgICAgICovCi0JCQkvKiAtIERpc2FibGUgdGhlIHJlc2V0ICAgICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSB0aW1lciBtb2RlICAgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJCS8qIFNldCB0aGUgbW9kZSA6ICAgICAgICAgICAgICovCisJCS8qIC0gRGlzYWJsZSB0aGUgaGFyZHdhcmUgICAgICovCisJCS8qIC0gR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FbNF0gPT0gQURESURBVEFfRU5BQkxFKSB7Ci0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKIAkJLyogU2V0IHRoZSBoYXJkd2FyZSB0cmlnZ2VyIGxldmVsICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kIHwgKGRhdGFbNV0gPDwgNSk7CiAJfQogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0JdWlfQ29tbWFuZCA9IDA7CisKIAl1aV9Db21tYW5kID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgZ2F0ZSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgZ2F0ZSAqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjg3RlVMOwogCWlmIChkYXRhWzZdID09IEFERElEQVRBX0VOQUJMRSkgewotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBTZXQgdGhlIGhhcmR3YXJlIGdhdGUgbGV2ZWwgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJCS8qIFNldCB0aGUgaGFyZHdhcmUgZ2F0ZSBsZXZlbCAqLwogCQl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzddIDw8IDcpOwogCX0KIAlvdXRsKHVpX0NvbW1hbmQsIGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCXVpX0NvbW1hbmQgPSAwOworCiAJdWlfQ29tbWFuZCA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgb3V0cHV0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCS8qIERpc2FibGUgdGhlIGhhcmR3YXJlIG91dHB1dCAqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjlGQlVMOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFNldCB0aGUgaGFyZHdhcmUgb3V0cHV0IGxldmVsICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogU2V0IHRoZSBoYXJkd2FyZSBvdXRwdXQgbGV2ZWwgKi8KIAl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzhdIDw8IDIpOwogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7CiAJaWYgKGRhdGFbOV0gPT0gQURESURBVEFfRU5BQkxFKSB7Ci0gICAvKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJCS8qIFNldCB0aGUgcmVsb2FkIHZhbHVlICovCi0gICAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRsKGRhdGFbMTFdLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAyNCk7Ci0gICAvKioqKioqKioqKioqKioqKioqKioqKi8KKwogCQkvKiBTZXQgdGhlIHRpbWUgdW5pdGUgKi8KLSAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRsKGRhdGFbMTBdLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAyOCk7CiAJfQogCi0JdWlfQ29tbWFuZCA9IDA7CiAJdWlfQ29tbWFuZCA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogCS8qIERpc2FibGUgdGhlIGhhcmR3YXJlIG91dHB1dCAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjlGN1VMOwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogCS8qIFNldCB0aGUgaGFyZHdhcmUgb3V0cHV0IGxldmVsICovCi0gICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kIHwgKGRhdGFbMTJdIDw8IDMpOwogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gLyoqICBFbmFibGUgdGhlIHdhdGNoZG9nIGludGVycnVwdCAgKiovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JdWlfQ29tbWFuZCA9IDA7CisKKwkvKiBFbmFibGUgdGhlIHdhdGNoZG9nIGludGVycnVwdCAqLwogCXVpX0NvbW1hbmQgPSBpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFNldCB0aGUgaW50ZXJydXB0IHNlbGVjdGlvbiAqLwotLyoqKioqKioqKioqKioqKioqKioqK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RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gOiAwIC0gU3RvcCBTZWxlY3RlZCBUaW1lci9XYXRjaGRvZyAgICAgfAotfAkJCQkJICAgICAgICAgICAgMSAtIFN0YXJ0IFNlbGVjdGVkIFRpbWVyL1dhdGNoZG9nICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDIgLSBUcmlnZ2VyIFNlbGVjdGVkIFRpbWVyL1dhdGNoZG9nICB8Ci18CQkJCQkgICAgICAgICAgICAzIC0gU3RvcCBBbGwgVGltZXIvV2F0Y2hkb2cgICAgICAgICAgfAotfAkJCQkJICAgICAgICAgICAgNCAtIFN0YXJ0IEFsbCBUaW1lci9XYXRjaGRvZyAgICAgICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDUgLSBUcmlnZ2VyIEFsbCBUaW1lci9XYXRjaGRvZyAgICAgICB8Ci18CQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gY29tZWRpX2RldmljZSAqZGV2LAorCQkJICAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbiwKKwkJCSAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEpCiB7CiAJc3RydWN0IGFkZGlfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKLQl1bnNpZ25lZCBpbnQgdWlfQ29tbWFuZCA9IDA7Ci0JaW50IGlfQ291bnQgPSAwOworCXVuc2lnbmVkIGludCB1aV9Db21tYW5kOworCWludCBpX0NvdW50OwogCiAJaWYgKGRhdGFbMF0gPT0gMSkgewogCQl1aV9Db21tYW5kID0KIAkJCWlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKiovCisKIAkJLyogU3RhcnQgdGhlIGhhcmR3YXJlICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQl1aV9Db21tYW5kID0gKHVpX0NvbW1hbmQgJiAweEZGRkZGOUZGVUwpIHwgMHgxVUw7CiAJCW91dGwodWlfQ29tbWFuZCwKIAkJCWRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCX0JCQkvKiAgaWYgIChkYXRhWzBdPT0xKSAqLworCX0KIAlpZiAoZGF0YVswXSA9PSAyKSB7CiAJCXVpX0NvbW1hbmQgPQogCQkJaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJCS8qIFNldCB0aGUgdHJpZ2dlciBjb21tYW5kICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCXVpX0NvbW1hbmQgPSAodWlfQ29tbWFuZCA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WQgVGhlIFNlbGVjdGVkIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgCQkJCQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJZGF0YVswXSAgICAgICAgICAgIDogc29mdHdhcmUgdHJpZ2dlciBzdGF0dXMKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzCi18ICAgICAJICAJICAgICAgICBkYXRhWzJdICAgICAgICAgICAgOiBTb2Z0d2FyZSBjbGVhciBzdGF0dXMKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbM10gICAgICAgICAgICA6IE92ZXJmbG93IHN0YXR1cwotfCAgICAgICAgICAgICAgICAgICAgICA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NpMDM1X3RpbWVyX3JlYWQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JdW5zaWduZWQgaW50IHVpX1N0YXR1cyA9IDA7CS8qICBTdGF0dXMgcmVnaXN0ZXIgKi8KKwl1bnNpZ25lZCBpbnQgdWlfU3RhdHVzOwkvKiAgU3RhdHVzIHJlZ2lzdGVyICovCiAKIAlpX1dhdGNoZG9nTmJyID0gaW5zbi0+dW51c2VkWzBdOwogCi0JLyoqKioqKioqKioqKioqKioqKi8KIAkvKiBHZXQgdGhlIHN0YXR1cyAqLwotCS8qKioqKioqKioqKioqKioqKiovCi0KIAl1aV9TdGF0dXMgPSBpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxNik7CiAKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogR2V0IHRoZSBzb2Z0d2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQogCWRhdGFbMF0gPSAoKHVpX1N0YXR1cyA+PiAxKSAmIDEpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBHZXQgdGhlIGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCWRhdGFbMV0gPSAoKHVpX1N0YXR1cyA+PiAyKSAmIDEpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JLyogR2V0IHRoZSBz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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IEZ1bmN0aW9uICAgTmFtZSAgIDogaW50IGlfQVBDSTAzNV9Db25maWdBbmFsb2dJbnB1dCAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkgIChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmVzIFRoZSBBbmFsb2cgSW5wdXQgU3ViZGV2aWNlICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgIDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMgICAgIDogU3ViZGV2aWNlIFBvaW50ZXIgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuICAgICAgIDogSW5zbiBTdHJ1Y3R1cmUgUG9pbnRlciAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgIDogRGF0YSBQb2ludGVyIGNvbnRhaW5zICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgICAgOiBXYXJuaW5nIGRlbGF5IHZhbHVlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6CS0tCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiBUUlVFICA6IE5vIGVycm9yIG9jY3VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJICAgICAgICAgICAgOiBGQUxTRSA6IEVycm9yIG9jY3VyLiBSZXR1cm4gdGhlIGVycm9yICAgICAgICAgIHwKLXwJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTAzNV9Db25maWdBbmFsb2dJbnB1dChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCSAgICAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAq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wgVmFsdWUgT2YgSW5wdXQKKyAqLworc3RhdGljIGludCBhcGNpMDM1X2FpX3JlYWQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JdW5zaWduZWQgaW50IHVpX0NvbW1hbmRSZWdpc3RlciA9IDA7CisJdW5zaWduZWQgaW50IHVpX0NvbW1hbmRSZWdpc3RlcjsKIAotLyoqKioqKioqKioqKioqKioqKi8KLS8qICBTZXQgdGhlIHN0YXJ0ICovCi0vKioqKioqKioqKioqKioqKioqLworCS8qICBTZXQgdGhlIHN0YXJ0ICovCiAJdWlfQ29tbWFuZFJlZ2lzdGVyID0gMHg4MDAwMDsKLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJLyogV3JpdGUgdGhlIGNvbW1hbmQgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGwodWlfQ29tbWFuZFJlZ2lzdGVyLCBkZXZwcml2LT5pb2Jhc2UgKyAxMjggKyA4KTsKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFJlYWQgdGhlIGRpZ2l0YWwgdmFsdWUgb2YgdGhlIGlucHV0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCS8qIFJlYWQgdGhlIGRpZ2l0YWwgdmFsdWUgb2YgdGhlIGlucHV0ICovCiAJZGF0YVswXSA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAxMjggKyAyOCk7CiAJcmV0dXJuIGluc24tPm47CiB9CiAKLS8qCi0rLS0tLS0tLS0tLS0tLS0tLS0tL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0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotCi0vKioqKioqKioqICAgICAgRGVmaW5pdGlvbnMgZm9yIEFQQ0ktMTUwMCBjYXJkICAqKioqKi8KKyAqIENvcHlyaWdodCAoQykgMjAwNCwyMDA1ICBBRERJLURBVEEgR21iSCBmb3IgdGhlIHNvdXJjZSBjb2RlIG9mIHRoaXMgbW9kdWxlLgorICoKKyAqCUFEREktREFUQSBHbWJICisgKglEaW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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCSAgZGF0YVswXSAgICAgICAgICAgIDpOdW1iZXIgb2YgdGhlIGlucHV0IHBvcnQgb24gICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWNoIHRoZSBldmVudCB3aWxsIHRha2UgcGxhY2UgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgb3IgMikKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgIDogVGhlIGV2ZW50IGxvZ2ljIGZvciBwb3J0IDEgaGFzICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocmVlIHBvc3NpYmlsaXRpZXMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6MCAgQVBDSTE1MDBfQU5EICAgICAgIDpUaGlzIGxvZ2ljICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtzICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGlucHV0cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGFuIEFORCB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2ljLiAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIEFQQ0kxNTAwX09SICAgICAgICA6VGhpcyBsb2dpYyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rcyAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBpbnB1dHMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aCBhICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYy4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICBBUENJMTUwMF9PUl9QUklPUklUWSAgICAgICAgfAotfAkJCQkJCQkJOlRoaXMgbG9naWMgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3MgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgaW5wdXRzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHkgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYy4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucHV0IDEgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzIHRoZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0ICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWwgYW5kICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCAgIDggICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzbWFsbGVzdHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciB0aGUgc2Vjb25kIHBvcnQgdGhlIHVzZXIgaGFzfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSBwb3NzaWJpbGl0eTogICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTUwMF9PUiAgICAgICAgOlRoaXMgbG9naWMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3MgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgaW5wdXRzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9sYXJpdHkgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSAgICAgICAgICAgICAgOiBUaGVzZSA4LWNoYXJhY3RlciB3b3JkIGZvciBwb3J0MXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCA2LWNoYXJhY3RlciB3b3JkIGZvciBwb3J0IDIgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2l2ZSB0aGUgbWFzayBvZiB0aGUgZXZlbnQuICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFYWNoIHBsYWNlIGdpdmVzIHRoZSBzdGF0ZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBpbnB1dCBjaGFubmVscyBhbmQgY2FuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGF2ZSBvbmUgb2YgdGhlc2Ugc2l4IGNoYXJhY3RlcnN8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgOiBUaGlzIGlucHV0IG11c3QgYmUgb24gMCAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICA6IFRoaXMgaW5wdXQgbXVzdCBiZSBvbiAxICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgIDogVGhpcyBpbnB1dCByZWFjdHMgdG8gICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIGZhbGxpbmcgZWRnZSAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICA6IFRoaXMgaW5wdXQgcmVhY3RzIHRvIGEgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlzaW5nIGVkZ2UgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCAgOiBUaGlzIGlucHV0IHJlYWN0cyB0byBib3RoIGVkZ2VzIHwKLXwKLXwJCQkJCQkJCTUgIDogVGhpcyBpbnB1dCBpcyBub3QgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VkIGZvciBldmVudCAgIAkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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CisgKgk0IFRoaXMgaW5wdXQgcmVhY3RzIHRvIGJvdGggZWRnZXMKKyAqCTUgVGhpcyBpbnB1dCBpcyBub3QgdXNlZCBmb3IgZXZlbnQKKyAqLworc3RhdGljIGludCBhcGNpMTUwMF9kaV9jb25maWcoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7CiAJaW50IGlfUGF0dGVyblBvbGFyaXR5ID0gMCwgaV9QYXR0ZXJuVHJhbnNpdGlvbiA9IDAsIGlfUGF0dGVybk1hc2sgPSAwOwpAQCAtMjQxLDE0ICsxNjQsMTAgQEAKIAlpbnQgaV9QYXR0ZXJuVHJhbnNpdGlvbkNvdW50ID0gMCwgaV9SZWdWYWx1ZTsKIAlpbnQgaTsKIAotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBEaXNhYmxlcyAgdGhlIG1haW4gaW50ZXJydXB0IG9uIHRoZSBib2FyZCAqLwotICAgICAgLyoqKioqKioqKioq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FxuIik7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGhlIG9wdGlvbiBpbmRpY2F0ZWQgaW4gdGhlIGV2ZW50IG1hc2sgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBzd2l0Y2goaV9FdmVudE1hc2spICovCiAJfQkJCS8qIGZvciAoaV9Db3VudCA9IGlfTWF4Q2hhbm5lbDsgaV9Db3VudCA+MDtpX0NvdW50IC0tKSAqLwogCiAJaWYgKGRhdGFbMF0gPT0gMSkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIGludGVycnVwdCBsb2dpYyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKGRhdGFbMV0gPT0gQVBDSTE1MDBfQU5EIHx8CiAJCQlkYXRhWzFdID09IEFQQ0kxNTAwX09SIHx8CiAJCQlkYXRhWzFdID09IEFQQ0kxNTAwX09SX1BSSU9SSVRZKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBUZXN0cyBpZiBhIHRyYW5zaXRpb24gd2FzIGRlY2xhcmVkICovCiAJCQkvKiBmb3IgYSBPUiBQUklPUklUWSBsb2dpYyAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCWlmIChkYXRhWzFdID09IEFQQ0kxNTAwX09SX1BSSU9SSVRZCiAJCQkJJiYgaV9QYXR0ZXJuVHJhbnNpdGlvbiAhPSAwKSB7Ci0JCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBPUiBQUklPUklUWSBsb2dpYyAqLwotCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCXByaW50aygiXG5UcmFuc2l0aW9uIGVycm9yIG9uIGFuIE9SIFBSSU9SSVRZIGxvZ2ljXG4iKTsKKwkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJIlRyYW5zaXRpb24gZXJyb3Igb24gYW4gT1IgUFJJT1JJVFkgbG9naWNcbiIpOwogCQkJCXJldHVybiAtRUlOVkFMOwogCQkJfQkvKiAgaWYgKGRhdGFbMV09PSBBUENJMTUwMF9PUl9QUklPUklUWSAmJiBpX1BhdHRlcm5UcmFuc2l0aW9uICE9IDApICovCiAKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdHMgaWYgbW9yZSB0aGFuIG9uZSB0cmFuc2l0aW9uICovCiAJCQkvKiB3YXMgZGVjbGFyZWQgZm9yIGFuIEFORCBsb2dpYyAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpZiAoZGF0YVsxXSA9PSBBUENJMTUwMF9BTkQpIHsKIAkJCQlmb3IgKGlfQ291bnQgPSAwOyBpX0NvdW50IDwgODsgaV9Db3VudCsrKSB7CkBAIC0zNjAsMjkgKzI3NCwyMSBAQAogCQkJCX0JLyogZm9yIChpX0NvdW50ID0gMDsgaV9Db3VudCA8IDg7IGlfQ291bnQrKykgKi8KIAogCQkJCWlmIChpX1BhdHRlcm5UcmFuc2l0aW9uQ291bnQgPiAxKSB7Ci0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBBTkQgbG9naWMgICAgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJcHJpbnRrKCJcbiBUcmFuc2l0aW9uIGVycm9yIG9uIGFuIEFORCBsb2dpY1xuIik7CisJCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkJIlRyYW5zaXRpb24gZXJyb3Igb24gYW4gQU5EIGxvZ2ljXG4iKTsKIAkJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQkJfQkvKiAgaWYgKGlfUGF0dGVyblRyYW5zaXRpb25Db3VudCA+IDEpICovCiAJCQl9CS8qICBpZiAoZGF0YVsxXT09IEFQQ0kxNTAwX0FORCkgKi8KIAotCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEaXNhYmxlIFBvcnQgQSAqLwotCQkJICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKDB4RjAsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCAxICAgICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9QQVRURVJOX1BPTEFSSVRZLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0zOTAsMjAgKzI5NiwxNiBAQAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIG1hc2sgcmVnaXN0ZXIgb2YgICAgICAqLwogCQkJLyogcG9ydCAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfUEFUVEVSTl9NQVNLLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQlvdXRiKGlfUGF0dGVybk1hc2ssCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIHBhdHRlcm4gdHJhbnNpdGlvbiByZWdpc3RlciAgKi8KIAkJCS8qIG9mIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9QQVRURVJOX1RSQU5TSVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQxMSwxMCArMzEzLDggQEAKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gbWFzayAgICAqLwogCQkJLyogcmVnaXN0ZXIgb2YgcG9ydCAxICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQyMiwxNyArMzIyLDEzIEBACiAJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IDEgICAgICAgICAgICAgICAgICAgICAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogUG9ydCBBIG5ldyBtb2RlICAgICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweEY5KSB8IGRhdGFbMV0gfCAweDk7CiAJCQlvdXRiKGlfUmVnVmFsdWUsCkBAIC00NDEsNTMgKzMzNyw0MCBAQAogCiAJCQlpX0V2ZW50MVN0YXR1cyA9IDE7CiAKLQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkvKiBFbmFibGUgUG9ydCBBICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoMHhGNCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCX0JCS8qICBpZihkYXRhWzFdPT1BUENJMTUwMF9BTkR8fGRhdGFbMV09PUFQQ0kxNTAwX09SfHxkYXRhWzFdPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAkJZWxzZSB7Ci0JCQlwcmludGsoIlxuVGhlIGNob2ljZSBmb3IgaW50ZXJydXB0IGxvZ2ljIGRvZXMgbm90IGV4aXN0XG4iKTsKKwkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCSJUaGUgY2hvaWNlIGZvciBpbnRlcnJ1cHQgbG9naWMgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBlbHNlIH0vLyBpZihkYXRhWzFdPT1BUENJMTUwMF9BTkR8fGRhdGFbMV09PUFQQ0kxNTAwX09SfHxkYXRhWzFdPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAl9CQkJLyogICAgaWYgKGRhdGFbMF09PSAxKSAqLwogCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFRlc3QgaWYgZXZlbnQgc2V0dGluZyBmb3IgcG9ydCAyICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJaWYgKGRhdGFbMF0gPT0gMikgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogVGVzdCB0aGUgZXZlbnQgbG9naWMgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKGRhdGFbMV0gPT0gQVBDSTE1MDBfT1IpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERpc2FibGUgUG9ydCBCICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YigweDc0LAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAqLwogCQkJLyogcmVnaXN0ZXIgb2YgcG9ydCBCICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQ5NSwxMCArMzc4LDggQEAKIAkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IEIgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTUwNywzNyArMzg4LDI5IEBACiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIGVycm9yIGNoYW5uZWxzIDEgYW5kIDIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpX1BhdHRlcm5NYXNrID0gKGlfUGF0dGVybk1hc2sgfCAweEMwKTsKIAkJCWlfUGF0dGVyblBvbGFyaXR5ID0gKGlfUGF0dGVyblBvbGFyaXR5IHwgMHhDMCk7CiAJCQlpX1BhdHRlcm5UcmFuc2l0aW9uID0gKGlfUGF0dGVyblRyYW5zaXRpb24gfCAweEMwKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwb2xhcml0eSByZWdpc3RlciBvZiBwb3J0IDIgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfUEFUVEVSTl9QT0xBUklUWSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJb3V0YihpX1BhdHRlcm5Qb2xhcml0eSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHRyYW5zaXRpb24gcmVnaXN0ZXIgICAgKi8KIAkJCS8qIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX1RSQU5TSVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCW91dGIoaV9QYXR0ZXJuVHJhbnNpdGlvbiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIE1hc2sgcmVnaXN0ZXIgICAgKi8KIAkJCS8qIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1BBVFRFUk5fTUFTSywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwpAQCAtNTQ2LDIwICs0MTksMTYgQEAKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIG1hc2sgICAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJaV9SZWdWYWx1ZSA9CiAJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIG1hc2sgICAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtNTY5LDIzICs0MzgsMjAgQEAKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAogCQkJaV9FdmVudDJTdGF0dXMgPSAxOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKio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RpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiAgQWxsb3dzIG9yIGRpc2FsbG93cyBhIHBvcnQgZXZlbnQgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgIDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB1aV9DaGFubmVsIDogQ2hhbm5lbCBudW1iZXIgdG8gcmVhZCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgIDogRGF0YSBQb2ludGVyIHRvIHJlYWQgc3RhdHVzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMF0gICAgICAgICAgICAgICAgIDowIFN0YXJ0IGlucHV0IGV2ZW50Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIFN0b3AgaW5wdXQgZXZlbnQKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgICAgICAgOk5vIG9mIHBvcnQgKDEgb3IgMikKLSstLS0tLS0tLS0tLS0t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jdCBjb21lZGlfZGV2aWNlICpkZXYsCisJCQkgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCisJCQkgICAgIHVuc2lnbmVkIGludCAqZGF0YSkKIHsKIAlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwogCWludCBpX0V2ZW50MUludGVycnVwdFN0YXR1cyA9IDAsIGlfRXZlbnQySW50ZXJydXB0U3RhdHVzID0KQEAgLTYyNiw0OCArNDc2LDMwIEBACiAKIAlzd2l0Y2ggKGRhdGFbMF0pIHsKIAljYXNlIFNUQVJUOgotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBUZXN0cyB0aGUgcG9ydCBudW1iZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQlpZiAoZGF0YVsxXSA9PSAxIHx8IGRhdGFbMV0gPT0gMikgewotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBUZXN0IGlmIHBvcnQgMSBzZWxlY3RlZCAqLwotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCWlmIChkYXRhWzFdID09IDEpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUZXN0IGlmIGV2ZW50IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJaWYgKGlfRXZlbnQxU3RhdHVzID09IDEpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEFsbG93cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhDMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBFbmFibGUgUG9ydCBBICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGNCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTY4MCwxODUgKzUxMiwxNDIgQEAKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RDAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKIAkJCQl9CS8qICBpZihpX0V2ZW50MVN0YXR1cz09MSkgKi8KIAkJCQllbHNlIHsKLQkJCQkJcHJpbnRrKCJcbkV2ZW50IDEgbm90IGluaXRpYWxpc2VkXG4iKTsKKwkJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCQkiRXZlbnQgMSBub3QgaW5pdGlhbGlzZWRcbiIpOwogCQkJCQlyZXR1cm4gLUVJTlZBTDsKIAkJCQl9CS8qIGVsc2UgaWYoaV9FdmVudDFTdGF0dXM9PTEpICovCiAJCQl9CS8qIGlmIChkYXRhWzFdPT0xKSAqLwogCQkJaWYgKGRhdGFbMV0gPT0gMikgewogCiAJCQkJaWYgKGlfRXZlbnQyU3RhdHVzID09IDEpIHsKLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBEaXNhYmxlIFBvcnQgQiAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweDc0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mICAgICAgKi8KIAkJCQkJLyogcG9ydCAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogQWxsb3dzIHRoZSBwYXR0ZXJuIGludGVycnVwdCAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEMwLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEVuYWJsZSBQb3J0IEIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEY0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RDAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OV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HsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUZXN0IGlmIGV2ZW50IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJaWYgKGlfRXZlbnQxU3RhdHVzID09IDEpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEluaGliaXRzIHRoZSBwYXR0ZXJuIGludGVycnVwdCAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEUwLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEVuYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEY0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJCQlpX0V2ZW50MUludGVycnVwdFN0YXR1cyA9IDA7CiAJCQkJfQkvKiAgaWYoaV9FdmVudDFTdGF0dXM9PTEpICovCiAJCQkJZWxzZSB7Ci0JCQkJCXByaW50aygiXG5FdmVudCAxIG5vdCBpbml0aWFsaXNlZFxuIik7CisJCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkJIkV2ZW50IDEgbm90IGluaXRpYWxpc2VkXG4iKTsKIAkJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQkJfQkvKiBlbHNlIGlmKGlfRXZlbnQxU3RhdHVzPT0xKSAqLwogCQkJfQkvKiBpZiAoZGF0YVsxXT09MSkgKi8KIAkJCWlmIChkYXRhWzFdID09IDIpIHsKLQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBldmVudCBpbml0aWFsaXNlZCAqLwotCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlpZiAoaV9FdmVudDJTdGF0dXMgPT0gMSkgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBEaXNhYmxlIFBvcnQgQiAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4NzQsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfQ09NTUFORF9BTkRfU1RBVFVTLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBJbmhpYml0cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhFMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQ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cmF0aW9uIGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKDB4RjQsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiByZWdpc3RlciBvZiBwb3J0IEEgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfU1BFQ0lGSUNBVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweDEwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTk0Myw5ICs3MTAsNyBAQAogCS8qIERlbGV0ZXMgdGhlIHJlZ2lzdGVyICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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gVGltZXIgMiBpbnRlcnJ1cHQgbWFuYWdlbWVudDogICAgICAgICAgICAgICAqLwogCW91dGIoMHhFMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBJUCBhbmQgSVVTICovCkBAIC0xMDI4LDkgKzc4NSw3IEBACiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlYWN0aXZhdGVzIGludGVycnVwdCBtYW5hZ2VtZW50IG9mIHRpbWVyIDM6ICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNT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tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywgICA6cG9pbnRlciB0byBzdWJkZXZpY2Ugc3RydWN0dXJlCi18ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gIDoxOk1lbW9yeSBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICAgICAgICAgICAgMDpNZW1vcnkgb2ZmICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICA6MSBFbmFibGUgdGhlIHZvbHRhZ2UgZXJyb3IgaW50ZXJydXB0Ci18CQkJCQkJCSAgIDowIERpc2FibGUgdGhlIHZvbHRhZ2UgZXJyb3IgaW50ZXJydXB0IAkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ldixzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcyxzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKXwKLXwJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmVzIFRoZSBXYXRjaGRvZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgIDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgIDogMiAgICAgQVBDSTE1MDBfMV84X0tIWgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBBUENJMTUwMF8zXzZfS0haICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgIEFQQ0kxNTAwXzExNV9LSFoKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIxL1RpbWVyMQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQ291bnRlcjIvVGltZXIyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBDb3VudGVyMy9XYXRjaGRvZwotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzJdICAgICAgICAgICAgICAgIDogMCAgICAgQ291bnRlcgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgVGltZXIvV2F0Y2hkb2cKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVszXSAgICAgICAgICAgICAgICA6ICAgICAgICAgVGhpcyBwYXJhbWV0ZXIgaGFzICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0d28gbWVhbmluZ3MuICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIElmIHRoZSBjb3VudGVyL3RpbWVyICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgdXNlZCBhcyBhIGNvdW50ZXIgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgbGltaXQgdmFsdWUgb2YgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBjb3VudGVyIGlzIGdpdmVuICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBJZiB0aGUgY291bnRlci90aW1lciAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzIHVzZWQgYXMgYSB0aW1lciwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGRpdmlkZXIgZmFjdG9yICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhlIG91dHB1dCBpcyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdpdmVuLgotfCAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSAgICAgICAgICAgICAgICAgOiAwICAgIEFQQ0kxNTAwX0NPTlRJTlVPVVMKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICBBUENJMTUwMF9TSU5HTEUKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNV0gICAgICAgICAgICAgICAgIDogMCAgICBTb2Z0d2FyZSBUcmlnZ2VyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgSGFyZHdhcmUgVHJpZ2dlcgotfAotfCAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs2XSAgICAgICAgICAgICAgICAgIDowICAgIFNvZnR3YXJlIGdhdGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICBIYXJkd2FyZSBnYXRlCi18ICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzddICAgICAgICAgICAg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VvdXMgbW9kZSBkb2VzIG5vdCBleGlzdFxuIik7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGhpcyBvcHRpb24gZm9yIHNpbmdsZS9jb250aW51b3VzIG1vZGUgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBzd2l0Y2goZGF0YVs0XSkgKi8KIAogCQlpX1RpbWVyQ291bnRlck1vZGUgPSBkYXRhWzJdIHwgZGF0YVs0XSB8IDc7Ci0JCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIHJlbG9hZCB2YWx1ZSAqLwotCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCWlmICgoZGF0YVszXSA+PSAwKSAmJiAoZGF0YVszXSA8PSA2NTUzNSkpIHsKIAkJCWlmIChkYXRhWzddID09IEFQQ0kxNTAwX0VOQUJMRQogCQkJCXx8IGRhdGFbN10gPT0gQVBDSTE1MDBfRElTQUJMRSkgewogCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9NT0RFX1NQRUNJRklDQVRJT04sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBtb2RlICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9UaW1lckNvdW50ZXJNb2RlLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9USU1FX0NTVF9MT1csCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGxvdyB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9USU1FX0NTVF9ISUdILAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgaGlnaCB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWRhdGFbM10gPSBkYXRhWzNdID4+IDg7CiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFJlYWRzIHRoZSByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gPQogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIEVuYWJsZXMgdGltZXIvY291bnRlciAxIGFuZCB0cmlnZ2VycyB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uIHwgMHg0MDsKIAotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIHJlZ2lzdGVyICovCi0JCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBjb25maWd1cmF0aW9uICovCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9NYXN0ZXJDb25maWd1cmF0aW9uLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIHJlZ2lzdGVyIG9mICAgICAqLwogCQkJCS8qIHRpbWVyL2NvdW50ZXIgMSAgICAgICAgICAgICAgICAgICAgICAqLwotCQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogRGlzYWJsZSB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoMHgwLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDEgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUcmlnZ2VyIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YigweDIsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJfQkvKiBpZihkYXRhWzddPT0gQVBDSTE1MDBfRU5BQkxFIHx8ZGF0YVs3XT09IEFQQ0kxNTAwX0RJU0FCTEUpICovCiAJCQllbHNlIHsKLQkJCQ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Pmh3X2RldiwKKwkJCQkiVGhpcyBjaG9pY2UgZm9yIHNvZnR3YXJlIG9yIGhhcmR3YXJlIGdhdGUgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBzd2l0Y2goZGF0YVs2XSkgKi8KIAogCQlpX1RpbWVyQ291bnRlck1vZGUgPSBkYXRhWzJdIHwgZGF0YVs0XSB8IGRhdGFbNV0gfCBkYXRhWzZdIHwgNzsKIAotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogVGVzdCB0aGUgcmVsb2FkIHZhbHVlICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCWlmICgoZGF0YVszXSA+PSAwKSAmJiAoZGF0YVszXSA8PSA2NTUzNSkpIHsKIAkJCWlmIChkYXRhWzddID09IEFQQ0kxNTAwX0VOQUJMRQogCQkJCXx8IGRhdGFbN10gPT0gQVBDSTE1MDBfRElTQUJMRSkgewogCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9NT0RFX1NQRUNJRklDQVRJT04sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBtb2RlICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9UaW1lckNvdW50ZXJNb2RlLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9USU1FX0NTVF9MT1csCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGxvdyB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9USU1FX0NTVF9ISUdILAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgaGlnaCB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWRhdGFbM10gPSBkYXRhWzNdID4+IDg7CiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFJlYWRzIHRoZSByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gPQogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIEVuYWJsZXMgdGltZXIvY291bnRlciAyIGFuZCB0cmlnZ2VycyB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uIHwgMHgyMDsKIAotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIHJlZ2lzdGVyICovCi0JCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBjb25maWd1cmF0aW9uICovCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9NYXN0ZXJDb25maWd1cmF0aW9uLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIHJlZ2lzdGVyIG9mICAgICAqLwogCQkJCS8qIHRpbWVyL2NvdW50ZXIgMiAgICAgICAgICAgICAgICAgICAgICAqLwotCQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogRGlzYWJsZSB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoMHgwLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDIgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUcmlnZ2VyIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YigweDIsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJfQkvKiBpZihkYXRhWzddPT0gQVBDSTE1MDBfRU5BQkxFIHx8ZGF0YVs3XT09IEFQQ0kxNTAwX0RJU0FCTEUpICovCiAJCQllbHNlIHsKLQkJCQlwcmludGsoIlxuRXJyb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FibGVzIHRoZSBvdXRwdXQgbGluZSAqLwogCQkJLyogLSBFbmFibGVzIHJldHJpZ2dlciAgICAgICAqLwogCQkJLyogLSBQdWxzZXMgb3V0cHV0ICAgICAgICAgICAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlpX1RpbWVyQ291bnRlck1vZGUgPSBkYXRhWzJdIHwgZGF0YVs0XSB8IDB4NTQ7CiAJCX0JCS8qIGlmIChkYXRhWzJdID09IEFQQ0kxNTAwX1dBVENIRE9HKSAqLwogCQllbHNlIHsKIAkJCWlfVGltZXJDb3VudGVyTW9kZSA9IGRhdGFbMl0gfCBkYXRhWzRdIHwgZGF0YVs2XSB8IDc7CiAJCX0JCS8qIGVsc2VpZiAoZGF0YVsyXSA9PSBBUENJMTUwMF9XQVRDSERPRykgKi8KLQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIHJlbG9hZCB2YWx1ZSAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQlpZiAoKGRhdGFbM10gPj0gMCkgJiYgKGRhdGFbM10gPD0gNjU1MzUpKSB7CiAJCQlpZiAoZGF0YVs3XSA9PSBBUENJMTUwMF9FTkFCTEUKIAkJCQl8fCBkYXRhWzddID09IEFQQ0kxNTAwX0RJU0FCTEUpIHsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbW9kZSByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfTU9ERV9TUEVDSUZJQ0FUSU9OLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgbW9kZSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfVGltZXJDb3VudGVyTW9kZSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfVElNRV9DU1RfTE9XLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBsb3cgdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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Ci0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBFbmFibGVzIHdhdGNoZG9nL2NvdW50ZXIgMyBhbmQgdHJpZ2dlcnMgd2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiA9CiAJCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiB8IDB4MTA7CiAKLQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfTWFzdGVyQ29uZmlndXJhdGlvbiwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBDT1VOVEVSICovCi0JCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqLwogCQkJCWlmIChkYXRhWzJdID09IEFQQ0kxNTAwX0NPVU5URVIpIHsKIAotCQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgcmVnaXN0ZXIgb2YgICAqLwogCQkJCQkvKiB3YXRjaGRvZy9jb3VudGVyIDMgICAgICAgICAgICAgICAgKi8KLQkJCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSB0aGUgIHdhdGNoZG9nL2NvdW50ZXIgMyBhbmQgc3RhcnRzIGl0ICovCi0JCQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4MCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCByZWdpc3RlciBvZiAgICovCiAJCQkJCS8qIHdhdGNoZG9nL2NvdW50ZXIgMyAgICAgICAgICAgICAgICAqLwotCQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVV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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBTdGFydCAvIFN0b3Agb3IgdHJpZ2dlciB0aGUgdGltZXIgY291bnRlciBvciBXYXRjaGRvZyAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIxL1RpbWVyMQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQ291bnRlcjIvVGltZXIyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBDb3VudGVyMy9XYXRjaGRvZwotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICAgICAgICAgICAgICAgIDogMCAgICAgc3RhcnQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIHN0b3AKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgIFRyaWdnZXIKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIFRpbWVyL1dhdGNoZG9nCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTAwX1N0YXJ0U3RvcFRyaWdnZXJUaW1lckNvdW50ZXJXYXRjaGRvZyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkJCSAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICp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UVuYWJsZWQgPSAxOwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMTkzOSwyMCArMTUxOCwxNyBAQAogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCX0JLyogaWYoIGlfVGltZXJDb3VudGVyMUluaXQ9PTEpICovCiAJCQllbHNlIHsKLQkJCQlwcmludGsoIlxuQ291bnRlci9UaW1lcjEgbm90IGNvbmZpZ3VyZWRcbiIpOworCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkiQ291bnRlci9UaW1lcjEgbm90IGNvbmZpZ3VyZWRcbiIpOwogCQkJCXJldHVybiAtRUlOVkFMOwogCQkJfQogCQkJYnJlYWs7CiAKIAkJY2FzZSBTVE9QOgogCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFN0b3AgdGltZXIvY291bnRlciAxICovCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZHMgYW5kIHN0YXR1cyByZWdpc3RlciAqLwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUw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QkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTIwMjYsMjAgKzE1OTQsMTcgQEAKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQl9CS8qIGlmKCBpX1RpbWVyQ291bnRlcjJJbml0PT0xKSAqLwogCQkJZWxzZSB7Ci0JCQkJcHJpbnRrKCJcbkNvdW50ZXIvVGltZXIyIG5vdCBjb25maWd1cmVkXG4iKTsKKwkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJIkNvdW50ZXIvVGltZXIyIG5vdCBjb25maWd1cmVkXG4iKTsKIAkJCQlyZXR1cm4gLUVJTlZBTDsKIAkJCX0KIAkJCWJyZWFrOwogCiAJCWNhc2UgU1RPUDoKIAotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTdG9wIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUld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0VuYWJsZWQgPSAxOwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjExMiwyMCArMTY2OSwxNyBAQAogCiAJCQl9CS8qICBpZiggaV9XYXRjaGRvZ0NvdW50ZXIzaW5pdD09MSkgKi8KIAkJCWVsc2UgewotCQkJCXByaW50aygiXG5XYXRjaGRvZy9Db3VudGVyMyBub3QgY29uZmlndXJlZFxuIik7CisJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCSJXYXRjaGRvZy9Db3VudGVyMyBub3QgY29uZmlndXJlZFxuIik7CiAJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQl9CiAJCQlicmVhazsKIAogCQljYXNlIFNUT1A6CiAKLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU3RvcCBXYXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9T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luc24gc3RydWN0dXJlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgIDogMCAgICAgQ291bnRlcjEvVGltZXIxCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBDb3VudGVyMi9UaW1lcjIKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgIENvdW50ZXIzL1dhdGNoZG9nCi18Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTAwX1JlYWRDb3VudGVyVGltZXJXYXRj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yMSBub3QgY29uZmlndXJlZFxuIik7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGltZXIvQ291bnRlcjEgbm90IGNvbmZpZ3VyZWRcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qIGVsc2VpZiggaV9UaW1lckNvdW50ZXIxSW5pdD09MSkgKi8KIAkJYnJlYWs7CkBAIC0yMjkzLDIzICsxODE4LDE3IEBACiAJCS8qIFJlYWQgY291bnRlci90aW1lcjIgKi8KIAkJaWYgKGlfVGltZXJDb3VudGVyMkluaXQgPT0gMSkgewogCQkJaWYgKGlfVGltZXJDb3VudGVyMkVuYWJsZWQgPT0gMSkgewotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2V0IFJDQyBhbmQgZ2F0ZSAqLwotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX0NvbW1hbmRBbmRTdGF0dXNWYWx1ZSA9IDB4QzsKIAkJCX0JLyogaWYoIGlfVGltZXJDb3VudGVyMkluaXQ9PTEpICovCiAJCQllbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKiovCiAJCQkJLyogU2V0IFJDQyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKi8KIAogCQkJCWlfQ29tbWFuZEFuZFN0YXR1c1ZhbHVlID0gMHg4OwogCQkJfQkvKiBlbHNlaWYoaV9UaW1lckNvdW50ZXIySW5pdD09MSkgKi8KIAotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfQ01EX1NUQVRVUywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUF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Ki8KIAkJCQkvKiBTZXQgUkNDIGFuZCBnYXRlICovCi0JCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfQ29tbWFuZEFuZFN0YXR1c1ZhbHVlID0gMHhDOwogCQkJfQkvKiBpZiggaV9UaW1lckNvdW50ZXIySW5pdD09MSkgKi8KIAkJCWVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZXQgUkNDICovCi0JCSAgICAvKioqKioqKioqKioqKioqLwogCiAJCQkJaV9Db21tYW5kQW5kU3RhdHVzVmFsdWUgPSAweDg7CiAJCQl9CS8qIGVsc2VpZihpX1dhdGNoZG9nQ291bnRlcjNJbml0PT0xKSAqLwogCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yMzY4LDkgKzE4ODAsNyBAQAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb3VudGVyIHJlZ2lzdGVyIChoaWdoKSAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUl9DUFRfVE1SM19WQUxVRV9ISUdILAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQ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KioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9SZWdWYWx1ZSA9IGluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9TUEVDSUZJQ0FUSU9OLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAoQVBDSTE1MDBfT1IpICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4RjkpIHwgQVBDSTE1MDBfT1I7CiAKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0gICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIEF1dGhvcmlzZXMgdGhlIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweEMwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIHBhdHRlcm4gcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX1BPTEFSSVRZLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKGlfQ29uc3RhbnQsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHRyYW5zaXRpb24gcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1BBVFRFUk5fVFJBTlNJVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihpX0NvbnN0YW50LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgcGF0dGVybiBtYXNrIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX01BU0ssCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoaV9Db25zdGFudCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlb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BUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMSAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAxICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAyICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9SZWdWYWx1ZSA9IGluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHRpbWVyIDMgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCW91dGIoaV9SZWdWYWx1ZSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDB4RDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0gICAgICAvKioqK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ovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0ludGVycnVwdFN0YXR1cyA9IGlubChkZXZwcml2LT5pX0lvYmFzZUFtY2MgKyAweDM4KTsKIAotICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFRlc3QgaWYgYm9hcmQgZ2VuZXJhdGVkIGEgaW50ZXJydXB0ICovCi0gIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJaWYgKCh1aV9JbnRlcnJ1cHRTdGF0dXMgJiAweDgwMDAwMCkgPT0gMHg4MDAwMDApIHsKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIERpc2FibGUgYWxsIEludGVycnVwdCAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCxkZXZwcml2LT5pb2Jhc2UrQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7ICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIERpc2FibGVzICB0aGUgbWFpbiBpbnRlcnJ1cHQgb24gdGhlIGJvYXJkICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIG91dGIoMHgwMCxkZXZwcml2LT5pb2Jhc2UrQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7ICovCiAKLSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiBwb3J0IEEgKi8KLQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCQkJb3V0YihpX1JlZ1ZhbHVlLAogCQkJCWRldnByaXYtPmlvYmFzZSArCkBAIC0yNjkzLDkgKzIwOTgsNyBAQAogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGludGVycnVwdCB2ZWN0b3IgcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yNzExLDQ1ICsyMTE0LDMyIEBACiAJCQl9CS8qIGVsc2VpZihpX0xvZ2ljPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCiAKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpX1JlZ1ZhbHVlID0KIAkJCWluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgewotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfQ09NTUFORF9BTkRfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgcG9ydCBCICovCi0JICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJCQlvdXRiKGlfUmVnVmFsdWUsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCXByaW50aygiXG5cblxuIik7Ci0JICAgICAvKioqKioqKioqKioqKioqKi8KIAkJCS8qIFJlYWRzIHBvcnQgQiAqLwotCSAgICAgLyoqKioqKioqKioqKioqKiovCiAJCQlpX1JlZ1ZhbHVlID0KIAkJCQlpbmIoKHVuc2lnbmVkIGludCkgZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9QT1JUX0IpOwogCiAJCQlpX1JlZ1ZhbHVlID0gaV9SZWdWYWx1ZSAmIDB4QzA7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdHMgaWYgdGhpcyBpcyBhbiBleHRlcm5hbCBlcnJvciAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJaWYgKGlfUmVnVmFsdWUpIHsKIAkJCQkvKiBEaXNhYmxlIHRoZSBpbnRlcnJ1cHQgKi8KLQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRsKDB4MCwgZGV2cHJpdi0+aV9Jb2Jhc2VBbWNjICsgMHgzOCk7CiAKIAkJCQlpZiAoaV9SZWdWYWx1ZSAmIDB4ODApIHsKQEAgLTI3NjcsNDYgKzIxNTcsMzQgQEAKIAkJCX0JLyogIGlmIChpX1JlZ1ZhbHVlKSAqLwogCQl9CQkvKiBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwogCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAxICovCi0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAkJCW91dGIoaV9SZWdWYWx1ZSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJaV9JbnRlcnJ1cHRNYXNrID0gaV9JbnRlcnJ1cHRNYXNrIHwgNDsKIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2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yArMjE5MiwxNyBAQAogCQkJaV9JbnRlcnJ1cHRNYXNrID0gaV9JbnRlcnJ1cHRNYXNrIHwgODsKIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCiAKLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpX1JlZ1ZhbHVlID0KIAkJCWluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgewotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHRpbWVyIDMgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCQkJb3V0YihpX1JlZ1ZhbHVlLAogCQkJCWRldnByaXYtPmlvYmFzZSArCkBAIC0yODQ0LDQyICsyMjE2LDIzIEBACiAJCX0JCS8qICBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwogCiAJCXNlbmRfc2lnKFNJR0lPLCBkZXZwcml2LT50c2tfQ3VycmVudCwgMCk7CS8qICBzZW5kIHNpZ25hbCB0byB0aGUgc2FtcGxlICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogRW5hYmxlIGFsbCBJbnRlcnJ1cHRzICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KIAotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogQXV0aG9yaXplcyB0aGUgbWFpbiBpbnRlcnJ1cHQgb24gdGhlIGJvYXJkICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKDB4RDAsIGRldnByaXYtPmlvYmFzZ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TVEVSKTsKIAlvdXRiKDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfRHVtbXlSZWFkID0gaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjkwOCwxNiArMjI1OSwxMiBAQAogCW91dGIoMSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiBjb250cm9sIHJlZ2lzdGVyICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweEY0LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1NQRUNJRklDQVRJT04sCiA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gICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgSVAgYW5kIElVUyAqLwpAQCAtMzAyMiw5ICsyMzYxLDcgQEAKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVhY3RpdmF0ZXMgVGltZXIgMiBpbnRlcnJ1cHQgbWFuYWdlbWVudDogICAgICAgICAgICAgICAqLwogCW91dGIoMHhFMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBJUCBhbmQgSVVTICovCkBAIC0zMDM0LDcxICsyMzcxLDQzIEBACiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlYWN0aXZhdGVzIGludGVycnVwdCBtYW5hZ2VtZW50IG9mIHRpbWVyIDM6ICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgYWxsIGludGVycnVwdHMgKi8KIAlvdXRiKDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIHJlc2V0IGFsbCB0aGUgZGlnaXRhbCBvdXRwdXRzICovCiAJb3V0dygweDAsIGRldnByaXYtPmlfSW9iYXNlQWRkb24gKyBBUENJMTUwMF9ESUdJVEFMX09QKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGlzYWJsZSB0aGUgYm9hcmQgaW50ZXJydXB0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEEgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGVhY3RpdmF0ZXMgYWxsIGludGVycnVwdHMgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweDAwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGVhY3RpdmF0ZXMgYWxsIGludGVycnVwdHMgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweDAwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMiAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBEZWFjdGl2YXRlcyBhbGwgaW50ZXJydXB0cyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDB4MDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDMqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJcmV0dXJuIDA7CiB9CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvYWRkaS1kYXRhL2h3ZHJ2X2FwY2kxNTY0LmMgYi9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvY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S0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8IFByb2plY3QgbWFuYWdlcjogRXJpYyBTdG9seiAgIHwgRGF0ZSAgICAgICA6ICAwMi8xMi8yMDAyICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCBEZXNjcmlwdGlvbiA6ICAgSGFyZHdhcmUgTGF5ZXIgQWNjZXNzIEZvciBBUENJLTE1NjQgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFURVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgRGF0ZSAgIHwgICBBdXRob3IgIHwgICAgICAgICAgRGVzY3JpcHRpb24gb2YgdXBkYXRlcyAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tKy0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAg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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZXMgdGhlIGRpZ2l0YWwgaW5wdXQgU3ViZGV2aWNlICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJICBkYXRhWzBdICAgICAgICAgICAgOiAxIEVuYWJsZSAgRGlnaXRhbCBJbnB1dCBJbnRlcnJ1cHQgfAotfAkJCQkJCQkJICAgMCBEaXNhYmxlIERpZ2l0YWwgSW5wdXQgSW50ZXJydXB0IHwKLXwJCQkgIGRhdGFbMV0gICAgICAgICAgICA6IDAgQURESURBVEEgSW50ZXJydXB0IE9SIExPR0lDCSB8Ci18CQkJCQkJCQkgOiAxIEFERElEQVRBIEludGVycnVwdCBBTkQgTE9HSUMgICAgfAotfAkJCSAgZGF0YVsyXQkJCSA6IEludGVycnVwdCBtYXNrIGZvciB0aGUgbW9kZSAxCSB8Ci18CQkJICBkYXRhWzNd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pZ2l0YWxPdXRwdXQgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJICAoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldixzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbix1bnNpZ25lZCBpbnQgKmRhdGEpICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogQ29uZmlndXJlcyBUaGUgRGlnaXRhbCBPdXRwdXQgU3ViZGV2aWNlLiAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgIDogRGF0YSBQb2ludGVyIGNvbnRhaW5zICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMV0gICAgICAgICAgICA6IDEgRW5hYmxlICBWQ0MgIEludGVycnVwdCAgfAotfAkJCQkJCQkJCQkgICAwIERpc2FibGUg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ICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZXMgVGhlIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICAgICAgICAgICAgOiAwIENvbmZpZ3VyZSBBcyBUaW1lciAgICAgIHwKLXwJCQkJCQkJCQkJICAgMSBDb25maWd1cmUgQXMgQ291bnRlciAgICB8Ci18CQkJCQkJCQkJCSAgIDIgQ29uZmlndXJlIEFzIFdhdGNoZG9nICAgfAotfAkJCQkJICBkYXRhWzFdICAgICAgICAgICAgOiAxIEVuYWJsZSAgSW50ZXJydXB0ICAgICAgIHwKLXwJCQkJCQkJCQ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SAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICAgICAgICAgICAgOiAwIFRpbWVyICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCQkJCQkJICAgMSBDb3VudGVyICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJCQkJCSAgIDIgV2F0Y2hkb2cgICAgICAgIAkJIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwJCQkJCSAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IDEgU3RhcnQgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJCQkJCQkgICAwIFN0b3AgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgVHJpZ2dlciAgICAgICAgICAgICAJIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xlYXIgKE9ubHkgQ291bnRlcikgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTY0X1JlYWRUaW1lckNvdW50ZXJXYXRjaGRvZyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkJCSAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCi0JCQkJCSAgICAgICB1bnNpZ25lZCBpbn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QVBDSTE1NjRfVENXX1NZTkNfRU5BQkxFRElTQUJMRSk7CisJCQlpbmwoZGV2cHJpdi0+aW9iYXNlICsKKwkJCQlBUENJMTU2NF9UQ1dfUkVHKGRldnByaXYtPmJfTW9kZVNlbGVjdFJlZ2lzdGVyIC0gMSkpOwogCQl1bF9Db21tYW5kMSA9Ci0JCQlpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChkZXZwcml2LT5iX01vZGVTZWxlY3RSZWdpc3RlciAtCi0JCQkJCTEpICogMHgyMCkgKyBBUENJMTU2NF9UQ1dfVFJJR19TVEFUVVMpOworCQkJaW5sKGRldnByaXYtPmlvYmFzZSArCisJCQkJQVBDSTE1NjRfVENXX1NUQVRVU19SRUcoZGV2cHJpdi0+Yl9Nb2RlU2VsZWN0UmVnaXN0ZXIgLSAxKSk7CiAKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogR2V0IHRoZSBzb2Z0d2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlkYXRhWzFdID0gKHVuc2lnbmVkIGNoYXIpICgodWxfQ29tbWFuZDEgPj4gMSkgJiAxKTsKIAotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBHZXQgdGhlIGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCWRhdGFbMl0gPSAodW5zaWduZWQgY2hhcikgKCh1bF9Db21tYW5kMSA+PiAyKSAmIDEpOwogCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBHZXQgdGhlIHNvZnR3YXJlIGNsZWFyIHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJZGF0YVszXSA9ICh1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zCisgKgkgICAgICAgICAgICAgICAgIDEgICAgICAgIDE1IHRvIDE2ICAgICAgMTcKKyAqCSAgICArLy0xMFYgICAgICAgMCAgICAgICAgMjAgdG8gMjIgICAgICAyMworICoJICAgICAgICAgICAgICAgICAxICAgICAgICAxNCB0byAxNiAgICAgIDE3CisgKgkgIDQgdG8gMjBtQSAgICAgIDAgICAgICAgIDIxIHRvIDIyICAgICAgMjUKKyAqCSAgICAgICAgICAgICAgICAgMSAgICAgICAgMTUgdG8gMTYgICAgICAxOQorICoJQUMgcmVmZXJlbmNlICAgICAwICAgICAgSW4gb24gcGluIDIyICAgIDI0ICgyLXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAgICAgICAgSW4gb24gcGluIDIyICAgIDIzICg0LXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAxICAgICAgSW4gb24gcGluIDE2ICAgIDE4ICgyLXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAgICAgICAgSW4gb24gcGluIDE2ICAgIDE3ICg0LXF1YWRyYW50KQorICovCitzdGF0aWMgY29uc3Qgc3RydWN0IGNvbWVkaV9scmFuZ2UgZGFzMDJfYW9fcmFuZ2VzID0geworCTYsIHsKKwkJVU5JX1JBTkdFKDUpLAorCQlVTklfUkFOR0UoMTApLAorCQlCSVBfUkFOR0UoNSksCisJCUJJUF9SQU5HRSgxMCksCisJCVJBTkdFX21BKDQsIDIwKSwKKwkJUkFOR0VfZXh0KDAsIDEpCisJfQorfTsKKworc3RydWN0IGRhYzAyX3ByaXZhdGUgeworCXVuc2lnbmVkIGludCBhb19yZWFkYmFja1syXTsKK307CisKKy8qCisgKiBSZWdpc3RlciBJL08gbWFwCisgKi8KKyNkZWZpbmUgREFDMDJfQU9fTFNCKHgpCQkoMHgwMCArICgoeCkgKiAyKSkKKyNkZWZpbmUgREFDMDJfQU9fTVNCKHgpCQkoMHgwMSArICgoeCkgKiAyKSkKKworc3RhdGljIGludCBkYWMwMl9hb19pbnNuX3dyaXRl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ci0Jc3RhcnRfcGFjZXIoZGV2LCAtMSwgMCwgMCk7CS8qICBzdG9wIDgyNTQgKi8KLQlvdXRiKDAsIGRldi0+aW9iYXNlICsgUENMODEyX0NMUklOVCk7CS8qIGNsZWFyIElOVCByZXF1ZXN0ICovCisKKwlvdXRiKGRldnByaXYtPm1vZGVfcmVnX2ludCB8IFBDTDgxMl9DVFJMX0RJU0FCTEVfVFJJRywKKwkgICAgIGRldi0+aW9iYXNlICsgUENMODEyX0NUUkxfUkVHKTsKKwlwY2w4MTJfc3RhcnRfcGFjZXIoZGV2LCBmYWxzZSk7CisJcGNsODEyX2FpX2NsZWFyX2VvYyhkZXYpOwogCXJldHVybiAwOwogfQogCi0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0qLworc3RhdGljIGludCBwY2w4MTJfYWlfaW5zbl9yZWFkKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCisJCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCisJCQkgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSkKK3sKKwlzdHJ1Y3QgcGNsODEyX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7CisJaW50IHJldCA9IDA7CisJaW50IGk7CisKKwlvdXRiKGRldnByaXYtPm1vZGVfcmVnX2ludCB8IFBDTDgxMl9DVFJMX1NPRlRfVFJJRywKKwkgICAgIGRldi0+aW9iYXNlICsgUENMODEyX0NUUkxfUkVHKTsKKworCXBjbDgxMl9haV9zZXRfY2hhbl9yYW5nZShkZXYsIGluc24tPmNoYW5zcGVjLCAxKTsKKworCWZvciAoaSA9IDA7IGkgPCBpbnNuLT5uOyBpKyspIHsKKwkJcGNsODEyX2FpX2NsZWFyX2VvYyhkZXYpOworCQlwY2w4MTJfYWl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25lZCBpbnQgY2hhbjsKKwl1bnNpZ25lZCBpbnQgdmFsOworCWludCBpLCBsZW4sIGJ1ZnB0cjsKKworCXBjbDgxOF9haV9zZXR1cF9uZXh0X2RtYShkZXYsIHMpOworCisJcHRyID0gKHVuc2lnbmVkIHNob3J0ICopZGV2cHJpdi0+ZG1hYnVmWzEgLSBkZXZwcml2LT5uZXh0X2RtYV9idWZdOworCisJbGVuID0gZGV2cHJpdi0+aHdkbWFzaXplID4+IDE7CisJYnVmcHRyID0gMDsKKworCWZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykgeworCQl2YWwgPSBwdHJbYnVmcHRyKytdOworCQljaGFuID0gdmFsICYgMHhmOworCQl2YWwgPSAodmFsID4+IDQpICYgcy0+bWF4ZGF0YTsKKworCQlpZiAocGNsODE4X2FpX2Ryb3BvdXQoZGV2LCBzLCBjaGFuKSkKKwkJCWJyZWFrOworCisJCWNvbWVkaV9idWZfcHV0KHMtPmFzeW5jLCB2YWwpOworCisJCWlmICghcGNsODE4X2FpX25leHRfY2hhbihkZXYsIHMpKQorCQkJYnJlYWs7CiAJfQogfQogCi0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gQ2hlY2sgaWYgY2hhbm5lbCBsaXN0IGZyb20gdXNlciBpcyBidWlsZGVkIGNvcnJlY3RseQotIElmIGl0J3Mgb2ssIHRoZW4gcHJvZ3JhbSBzY2FuL2dhaW4gbG9naWMKLSovCitzdGF0aWMgdm9pZCBwY2w4MThfaGFuZGxlX2ZpZm8oc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcykKK3sKKwl1bnNpZ25lZCBpbnQgc3RhdHVzOworCXVuc2lnbmVkIGludCBjaGFuOworCXVuc2lnbmVkIGludCB2YWw7CisJaW50IGksIGxlbjsKKworCXN0YXR1cy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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotIENoZWNrIGlmIGJvYXJkIGlzIHN3aXRjaGVkIHRvIFNFICgxKSBvciBESUZGKDApIG1vZGUKLSovCiBzdGF0aWMgaW50IGNoZWNrX3NpbmdsZV9lbmRlZCh1bnNpZ25lZCBpbnQgcG9ydCkKIHsKLQlpZiAoaW5iKHBvcnQgKyBQQ0w4MThfU1RBVFVTKSAmIDB4MjApCisJaWYgKGluYihwb3J0ICsgUENMODE4X1NUQVRVU19SRUcpICYgUENMODE4X1NUQVRVU19NVVgpCiAJCXJldHVybiAxOwogCXJldHVybiAwOwogfQogCi0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0qLwogc3RhdGljIGludCBhaV9jbWR0ZXN0KHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAogCQkgICAgICBzdHJ1Y3QgY29tZWRpX2NtZCAqY21kKQogewogCWNvbnN0IHN0cnVjdCBwY2w4MThfYm9hcmQgKmJvYXJkID0gY29tZWRpX2JvYXJkKGRldik7CiAJc3RydWN0IHBjbDgxOF9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwogCWludCBlcnIgPSAwOwotCWludCB0bXAsIGRpdmlzb3IxID0gMCwgZGl2aXNvcjIgPSAwOworCWludCB0bXA7CiAKIAkvKiBTdGVwIDEgOiBjaGVjayBpZiB0cmlnZ2VycyBhcmUgdHJpdmlhbGx5IHZhbGlkICovCiAKQEAgLTEwMzUsNyArNzkwLDggQEAKIAlpZiAoY21kLT5jb252ZXJ0X3NyYyA9PSBUUklHX1RJTUVSKSB7CiAJCXRtcCA9IGNtZC0+Y29udmVydF9hcmc7CiAJCWk4MjUzX2Nhc2NhZGVfbnNfdG9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iAoY3h0MWUxX2xvZ19sZXZlbCA+PSBMT0dfREVCVUcpCisJCXByX2luZm8oInBjaV9yZWFkIDogJXggPSAleFxuIiwgKHVfaW50MzJfdCkgcCwgdik7CisJcmV0dXJuIHY7CiAjZWxzZQotICAgIEZMVVNIX1BDSV9SRUFEICgpOyAgICAgICAgICAgICAgLyogKi8KLSAgICByZXR1cm4gbGUzMl90b19jcHUgKCpwKTsKKwlGTFVTSF9QQ0lfUkVBRCgpOyAgICAgICAgICAgICAgLyogKi8KKwlyZXR1cm4gbGUzMl90b19jcHUoKnApOwogI2VuZGlmCiB9CiAKIHZvaWQKLXBjaV93cml0ZV8zMiAodV9pbnQzMl90ICpwLCB1X2ludDMyX3QgdikKK3BjaV93cml0ZV8zMih1X2ludDMyX3QgKnAsIHVfaW50MzJfdCB2KQogewogI2lmZGVmIEZMT1dfREVCVUcKLSAgICBpZiAoY3h0MWUxX2xvZ19sZXZlbCA+PSBMT0dfREVCVUcpCi0gICAgICAgIHByX2luZm8oInBjaV93cml0ZTogJXggPSAleFxuIiwgKHVfaW50MzJfdCkgcCwgdik7CisJaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX0RFQlVHKQorCQlwcl9pbmZvKCJwY2lfd3JpdGU6ICV4ID0gJXhcbiIsICh1X2ludDMyX3QpIHAsIHYpOwogI2VuZGlmCi0gICAgKnAgPSBjcHVfdG9fbGUzMiAodik7Ci0gICAgRkxVU0hfUENJX1dSSVRFICgpOyAgICAgICAgICAgICAvKiBUaGlzIHJvdXRpbmUgaXMgY2FsbGVkIGZyb20gcm91dGluZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdoaWNoIGRvIG11bHRpcGxlIHJlZ2lzdGVyIHdyaXRlcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2hpY2ggdGhlbXNlbHZlcyBuZWVkIGZsdXNoaW5nIGJldHdlZW4KLSAgICAgICAgICAgICAgICAgICAgICAgIC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jdGlvbiA9IHdhdGNoZG9nX2Z1bmM7Ci0gICAgcmV0dXJuIDA7CisJCXdkcC0+aC5kYXRhID0gKHVuc2lnbmVkIGxvbmcpICZjaS0+d2Q7CisJfQorCXdkcC0+aC5mdW5jdGlvbiA9IHdhdGNoZG9nX2Z1bmM7CisJcmV0dXJuIDA7CiB9CiAKIHZvaWQKLU9TX3V3YWl0IChpbnQgdXNlYywgY2hhciAqZGVzY3JpcHRpb24pCitPU191d2FpdChpbnQgdXNlYywgY2hhciAqZGVzY3JpcHRpb24pCiB7Ci0gICAgaW50ICAgICAgICAgdG1wOworCWludCAgICAgICAgIHRtcDsKIAotICAgIGlmICh1c2VjID49IDEwMDApCi0gICAgewotICAgICAgICBtZGVsYXkgKHVzZWMgLyAxMDAwKTsKLSAgICAgICAgLyogbm93IGRlbGF5IHJlc2lkdWFsICovCi0gICAgICAgIHRtcCA9ICh1c2VjIC8gMTAwMCkgKiAxMDAwOyAvKiByb3VuZCAqLwotICAgICAgICB0bXAgPSB1c2VjIC0gdG1wOyAgICAgICAgICAgLyogcmVzaWR1YWwgKi8KLSAgICAgICAgaWYgKHRtcCkKLSAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdhaXQgb24gcmVzaWR1YWwgKi8KLSAgICAgICAgICAgIHVkZWxheSAodG1wKTsKLSAgICAgICAgfQotICAgIH0gZWxzZQotICAgIHsKLSAgICAgICAgdWRlbGF5ICh1c2VjKTsKLSAgICB9CisJaWYgKHVzZWMgPj0gMTAwMCkgeworCQltZGVsYXkodXNlYyAvIDEwMDApOworCQkvKiBub3cgZGVsYXkgcmVzaWR1YWwgKi8KKwkJdG1wID0gKHVzZWMgLyAxMDAwKSAqIDEwMDA7IC8qIHJvdW5kICovCisJCXRtcCA9IHVzZWMgLSB0bXA7ICAgICAgICAgICAvKiByZXNpZHVhbCAqLworCQlpZiAodG1wKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogd2FpdCBvbiByZXNpZHVh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ywKKwkJCQkgICAgICB1bnNpZ25lZCBsb25nLCBpbnQsIGludCk7CiAKIAogc3RydWN0IHNfaGR3X2luZm8gaGR3X2luZm9bTUFYX0JPQVJEU107CiAKIAotdm9pZCAgICAgICAgX19pbml0Ci1zaG93X3R3byAoaGR3X2luZm9fdCAqaGksIGludCBicmRubykKK3ZvaWQgX19pbml0CitzaG93X3R3byhoZHdfaW5mb190ICpoaSwgaW50IGJyZG5vKQogewotICAgIGNpX3QgICAgICAgKmNpOwotICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2OwotICAgIGNoYXIgICAgICAgKmJpZDsKLSAgICBjaGFyICAgICAgICpicCwgYmFubmVyWzgwXTsKLSAgICBjaGFyICAgICAgICBzbls2XTsKKwljaV90ICAgICAgICpjaTsKKwlzdHJ1Y3QgcGNpX2RldiAqcGRldjsKKwljaGFyICAgICAgICpiaWQ7CisJY2hhciAgICAgICBiYW5uZXJbODBdOworCWNoYXIJc25bNl0gPSB7MCx9OwogCi0gICAgYnAgPSBiYW5uZXI7Ci0gICAgbWVtc2V0IChiYW5uZXIsIDAsIDgwKTsgICAgICAgICAvKiBjbGVhciBwcmludCBidWZmZXIgKi8KKwljaSA9IChjaV90ICopKG5ldGRldl9wcml2KGhpLT5uZGV2KSk7CisJYmlkID0gc2JlaWRfZ2V0X2JkbmFtZShjaSk7CisJc3dpdGNoIChoaS0+cHJvbWZtdCkgeworCWNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisJCW1lbWNweShzbiwgaGktPm1mZ19pbmZvLnBmdDEuU2VyaWFsLCA2KTsKKwkJYnJlYWs7CisJY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMjoKKwkJbWVtY3B5KHNuLCBoaS0+bWZnX2luZm8ucGZ0Mi5TZXJpYWwsIDYpOworCQlicmVhazsKKwl9CiAKLSAgICBjaSA9IChjaV90ICopKG5ldGRldl9wcml2KGhpLT5uZGV2KSk7Ci0gICAgYmlkID0gc2JlaWRfZ2V0X2JkbmFtZS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ZGV2aWNlIChQQ0lfVkVORE9SX0lEX0NPTkVYQU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUENJX0RFVklDRV9JRF9DTjg0NzQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZGV2KSkpCi0gICAgewotICAgICAgICBpZiAoYzRfaGR3X2luaXQgKHBkZXYsIGZvdW5kKSkKLSAgICAgICAgICAgIGZvdW5kKys7Ci0gICAgfQotICAgIGlmICghZm91bmQpCi0gICAgewotICAgICAgICBwcl93YXJuaW5nKCJObyBib2FyZHMgZm91bmRcbiIpOwotICAgICAgICByZXR1cm4gLUVOT0RFVjsKLSAgICB9Ci0gICAgLyogc2FuaXR5IGNoZWNrIGZvciBjb25zaXN0ZW50IGhhcmR3YXJlIGZvdW5kICovCi0gICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChoaS0+cGNpX3Nsb3QgIT0gMHhmZiAmJiAoIWhpLT5hZGRyWzBdIHx8ICFoaS0+YWRkclsxXSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBzb21ldGhpbmcgdmVyeSB3cm9uZyB3aXRoIHBjaV9nZXRfZGV2aWNlXG4iLAotICAgICAgICAgICAgICAgICAgICAgICBoaS0+ZGV2bmFtZSk7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTzsKLSAgICAgICAgfQotICAgIH0KLSAgICAvKiBicmluZyBib2FyZCdzIG1lbW9yeSByZWdpb25zIG9uL2xpbmUgKi8KLSAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmKQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCi0gICAgICAgIHsKLQkgICAgaWYgKCFyZXF1ZXN0X21lbV9yZWdpb24gKGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdLCBoaS0+ZGV2bmFtZSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IG1lbW9yeSBpbiB1c2UsIGFkZHI9MHglbHgsIGxlbj0weCVseCA/XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUsIGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKLSAgICAgICAgICAgICAgICBjbGVhbnVwX2lvcmVtYXAgKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoaS0+YWRkcl9tYXBwZWRbal0gPSAodW5zaWduZWQgbG9uZykgaW9yZW1hcCAoaGktPmFkZHJbal0sIGhpLT5sZW5bal0pOwotICAgICAgICAgICAgaWYgKCFoaS0+YWRkcl9tYXBwZWRbal0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IGlvcmVtYXAgZmFpbHMsIGFkZHI9MHglbHgsIGxlbj0weCVseCA/XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUsIGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKLSAgICAgICAgICAgICAgICBjbGVhbnVwX2lvcmVtYXAgKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07Ci0gICAgICAgICAgICB9CisJZXJyb3JfZmxhZyA9IDA7CisJcHJlcF9oZHdfaW5mbygpOworCS8qKiogc2NhbiBQQ0kgYnVzIGZvciBhbGwgcG9zc2libGUgYm9hcmRzICovCisJd2hpbGUgKChwZGV2ID0gcGNpX2dldF9kZXZpY2UoUENJX1ZFTkRPUl9JRF9DT05FWEFOVCwKKwkJCQkgICAgICB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zIGFjY2VzcyB0byBzeXN0ZW0gKi8KLSAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmKQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGlmIChwY2lfZW5hYmxlX2RldmljZSAoaGktPnBkZXZbMF0pIHx8Ci0gICAgICAgICAgICBwY2lfZW5hYmxlX2RldmljZSAoaGktPnBkZXZbMV0pKQotICAgICAgICB7Ci0gICAgICAgICAgICBkcnZyX3N0YXRlID0gU0JFX0RSVlJfRE9XTjsKLSAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBmYWlsZWQgdG8gZW5hYmxlIGNhcmQgJWQgc2xvdCAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUsIGksIGhpLT5wY2lfc2xvdCk7Ci0gICAgICAgICAgICBjbGVhbnVwX2RldnMgKCk7Ci0gICAgICAgICAgICBjbGVhbnVwX2lvcmVtYXAgKCk7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTzsKLSAgICAgICAgfQotICAgICAgICBwY2lfc2V0X21hc3RlciAoaGktPnBkZXZbMF0pOwotICAgICAgICBwY2lfc2V0X21hc3RlciAoaGktPnBkZXZbMV0pOwotICAgICAgICBpZiAoIShoaS0+bmRldiA9IGM0X2FkZF9kZXYgKGhpLCBpLCAobG9uZykgaGktPmFkZHJfbWFwcGVkWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nKSBoaS0+YWRkcl9tYXBwZWRbMV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPnBkZXZbMF0tPmlycSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaS0+cGRldlsxXS0+aXJxKSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGR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GUgInNiZXByb2MuaCIKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogRXJyb3Igb3V0IGVhcmx5IGlmIHdlIGhhdmUgY29tcGlsZXIgdHJvdWJsZS4KICAqCiAgKiAgIChUaGlzIHNlY3Rpb24gaXMgaW5jbHVkZWQgZnJvbSB0aGUga2VybmVsJ3MgaW5pdC9tYWluLmMgYXMgYSBmcmllbmRseQpAQCAtNTAsNDMgKzUwLDQyIEBACiAjd2FybmluZyBnY2MtNC4xLjAgaXMga25vd24gdG8gbWlzY29tcGlsZSB0aGUga2VybmVsLiAgQSBkaWZmZXJlbnQgY29tcGlsZXIgdmVyc2lvbiBpcyByZWNvbW1lbmRlZC4KICNlbmRpZgogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogI2RlZmluZSBDSEFOTkFNRSAiaGRsYyIKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBmb3J3YXJkIHJlZmVyZW5jZXMgKi8KLXN0YXR1c190ICAgIGM0X2NoYW5fd29ya19pbml0IChtcGlfdCAqLCBtY2hfdCAqKTsKLXZvaWQgICAgICAgIG11c3ljY193cV9jaGFuX3Jlc3RhcnQgKHZvaWQgKik7Ci1zdGF0dXNfdCBfX2luaXQgYzRfaW5pdCAoY2lfdCAqLCB1X2NoYXIgKiwgdV9jaGFyICopOwotc3RhdHVzX3QgX19pbml0IGM0X2luaXQyIChjaV90ICopOwotY2lfdCAgICAgICAqX19pbml0IGM0X25ldyAodm9pZCAqKTsKLWludCBfX2luaXQgIGM0aHdfYXR0YWNoX2FsbCAodm9pZCk7Ci12b2lkIF9faW5pdCBoZHdfc25fZ2V0IChoZHdfaW5mb190ICosIGludCk7CitzdGF0dXNfdCAgICBjNF9jaGFuX3dvcmtfaW5pdChtcGlfdCAqLCBtY2hfdCAqKTsKK3ZvaWQgICAgICAgIG11c3ljY193cV9jaGFuX3Jlc3RhcnQodm9pZCAqKTsKK3N0YXR1c190IF9faW5pdCBjNF9pbml0KGNpX3QgKiwgdV9jaGFyICosIHVfY2hhciAqKTsKK3N0YXR1c190IF9faW5pdCBjNF9pbml0MihjaV90ICopOworY2lfdCAgICAgICAqX19pbml0IGM0X25ldyh2b2lkICopOworaW50IF9faW5pdCAgYzRod19hdHRhY2hfYWxsKHZvaWQpOwordm9pZCBfX2luaXQgaGR3X3NuX2dldChoZHdfaW5mb190ICosIGludCk7CiAKICNpZmRlZiBDT05GSUdfU0JFX1BNQ0M0X05DT01NCi1pcnFyZXR1cm5fdCBjNF9lYnVzX2ludHJfdGhfaGFuZGxlciAodm9pZCAqKTsKK2lycXJldHVybl90IGM0X2VidXNfaW50cl90aF9oYW5kbGVyKHZvaWQgKik7CiAKICNlbmRpZgotaW50ICAgICAgICAgYzRfZnJhbWVfcncgKGNpX3QgKiwgc3RydWN0IHNiZWNvbV9wb3J0X3BhcmFtICopOwotc3RhdHVzX3QgICAgYzRfZ2V0X3BvcnQgKGNpX3QgKiwgaW50KTsKLWludCAgICAgICAgIGM0X2xvb3BfcG9ydCAoY2lfdCAqLCBpbnQsIHVfaW50OF90KTsKLWludCAgICAgICAgIGM0X211c3ljY19ydyAoY2lfdCAqLCBzdHJ1Y3QgYzRfbXVzeWNjX3BhcmFtICopOwotaW50ICAgICAgICAgYzRfbmV3X2NoYW4gKGNpX3QgKiwgaW50LCBpbnQs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hbl9pbml0KG1waV90ICpwaSwgbWNoX3QgKmNoKQogewotICAgIC8qCi0gICAgICogdGhpcyB3aWxsIGJlIHVzZWQgdG8gcmVzdGFydCBhIHN0b3BwZWQgY2hhbm5lbAotICAgICAqLworCS8qCisJICogdGhpcyB3aWxsIGJlIHVzZWQgdG8gcmVzdGFydCBhIHN0b3BwZWQgY2hhbm5lbAorCSAqLwogCi0gICAgLyoqIElOSVRfV09SSyAoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrLAotICAgICAqKiAgICAgICAgICAgIHZvaWQgKCpmdW5jdGlvbikodm9pZCAqKSwKLSAgICAgKiogICAgICAgICAgICB2b2lkICpkYXRhKTsKLSAgICAgKiovCi0gICAgSU5JVF9XT1JLKCZjaC0+Y2hfd29yaywgKHZvaWQgKiltdXN5Y2Nfd3FfY2hhbl9yZXN0YXJ0KTsKLSAgICByZXR1cm4gMDsgICAgICAgICAgICAgICAgICAgICAgIC8qIHN1Y2Nlc3MgKi8KKwkvKiogSU5JVF9XT1JLKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yaywKKwkgKiogICAgICAgICAgIHZvaWQgKCpmdW5jdGlvbikodm9pZCAqKSwKKwkgKiogICAgICAgICAgIHZvaWQgKmRhdGEpOworCSAqKi8KKwlJTklUX1dPUksoJmNoLT5jaF93b3JrLCAodm9pZCAqKW11c3ljY193cV9jaGFuX3Jlc3RhcnQpOworCXJldHVybiAwOyAgICAgICAgICAgICAgICAgICAgICAgLyogc3VjY2VzcyAqLwogfQogCiBzdGF0dXNfdAotYzRfd3FfcG9ydF9pbml0IChtcGlfdCAqcGkpCitjNF93cV9wb3J0X2luaXQobXBpX3QgKnBpKQogewogCi0gICAgY2hhciAgICAgICAgbmFtZVsxNl0sICpucDsgIC8qIE5PVEU6IG5hbWUgb2YgdGhlIHF1ZXVlIGxpbWl0ZWQgYnkgc3lzdGVtCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIDEwIGNoYXJhY3Rlcn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kJcGktPndxX3BvcnQgPSBOVUxMOworCX0KIH0KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotaXJxcmV0dXJuX3QKLWM0X2xpbnV4X2ludGVycnVwdCAoaW50IGlycSwgdm9pZCAqZGV2X2luc3RhbmNlKQorc3RhdGljIGlycXJldHVybl90CitjNF9saW51eF9pbnRlcnJ1cHQoaW50IGlycSwgdm9pZCAqZGV2X2luc3RhbmNlKQogewotICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2ID0gZGV2X2luc3RhbmNlOworCXN0cnVjdCBuZXRfZGV2aWNlICpuZGV2ID0gZGV2X2luc3RhbmNlOwogCi0gICAgcmV0dXJuIG11c3ljY19pbnRyX3RoX2hhbmRsZXIobmV0ZGV2X3ByaXYobmRldikpOworCXJldHVybiBtdXN5Y2NfaW50cl90aF9oYW5kbGVyKG5ldGRldl9wcml2KG5kZXYpKTsKIH0KIAogCiAjaWZkZWYgQ09ORklHX1NCRV9QTUNDNF9OQ09NTQotaXJxcmV0dXJuX3QKLWM0X2VidXNfaW50ZXJydXB0IChpbnQgaXJxLCB2b2lkICpkZXZfaW5zdGFuY2UpCitzdGF0aWMgaXJxcmV0dXJuX3QKK2M0X2VidXNfaW50ZXJydXB0KGludCBpcnEsIHZvaWQgKmRldl9pbnN0YW5jZSkKIHsKLSAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiA9IGRldl9pbnN0YW5jZTsKKwlzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiA9IGRldl9pbnN0YW5jZTsKIAotICAgIHJldHVybiBjNF9lYnVzX2ludHJfdGhfaGFuZGxlcihuZXRkZXZfcHJpdihuZGV2KSk7CisJcmV0dXJuIGM0X2VidXNfaW50cl90aF9oYW5kbGVyKG5ldGRldl9wcml2KG5kZXYpKTsKIH0KICNlbmRpZgogCiAKIHN0YXRpYyBpbnQKLXZvaWRfb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sICZjcCk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CiAKLSAgICBpZiAoY29weV90b191c2VyIChkYXRhLCAmY3AsIHNpemVvZiAoc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtKSkpCi0gICAgICAgIHJldHVybiAtRUZBVUxUOwotICAgIHJldHVybiAwOworCWlmIChjb3B5X3RvX3VzZXIoZGF0YSwgJmNwLCBzaXplb2Yoc3RydWN0IHNiZWNvbV9jaGFuX3BhcmFtKSkpCisJCXJldHVybiAtRUZBVUxUOworCXJldHVybiAwOwogfQogCi1zdGF0aWMgICAgICBzdGF0dXNfdAotZG9fc2V0X2NoYW4gKHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2LCB2b2lkICpkYXRhKQorc3RhdGljIHN0YXR1c190Citkb19zZXRfY2hhbihzdHJ1Y3QgbmV0X2RldmljZSAqbmRldiwgdm9pZCAqZGF0YSkKIHsKLSAgICBzdHJ1Y3Qgc2JlY29tX2NoYW5fcGFyYW0gY3A7Ci0gICAgaW50ICAgICAgICAgcmV0OwotICAgIGNpX3QgICAgICAgKmNpOworCXN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSBjcDsKKwljaV90ICAgICAgICpjaTsKIAotICAgIGlmIChjb3B5X2Zyb21fdXNlciAoJmNwLCBkYXRhLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSkpKQotICAgICAgICByZXR1cm4gLUVGQVVMVDsKLSAgICBjaSA9IGdldF9jaV9ieV9kZXYgKG5kZXYpOwotICAgIGlmICghY2kpCi0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIHN3aXRjaCAocmV0ID0gbWtyZXQgKGM0X3NldF9jaGFuIChjcC5jaGFubnVtLCAmY3ApKSkKLSAgICB7Ci0gICAgY2FzZSAwOgotICAgICAgICByZXR1cm4gMDsKLSAgICBkZWZhdWx0OgotICAgICAgICByZXR1cm4gcmV0OwotICAgIH0KKwlpZiAoY29weV9mcm9tX3VzZ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dCAgICAgICAqY2k7Ci0gICAgICAgIG1jaF90ICAgICAgKmNoOwotICAgICAgICBjb25zdCBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKLSAgICAgICAgaW50ICAgICAgICAgY2hhbm51bTsKKwl7CisJCWNpX3QgICAgICAgKmNpOworCQltY2hfdCAgICAgICpjaDsKKwkJY29uc3Qgc3RydWN0IGM0X3ByaXYgKnByaXY7CisJCWludCAgICAgICAgIGNoYW5udW07CiAKLSAgICAgICAgcHJpdiA9IChzdHJ1Y3QgYzRfcHJpdiAqKSBkZXZfdG9faGRsYyAobmRldiktPnByaXY7Ci0gICAgICAgIGNpID0gcHJpdi0+Y2k7Ci0gICAgICAgIGNoYW5udW0gPSBwcml2LT5jaGFubnVtOworCQlwcml2ID0gKHN0cnVjdCBjNF9wcml2ICopZGV2X3RvX2hkbGMobmRldiktPnByaXY7CisJCWNpID0gcHJpdi0+Y2k7CisJCWNoYW5udW0gPSBwcml2LT5jaGFubnVtOwogCi0gICAgICAgIGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKTsKLSAgICAgICAgaWYgKGNoID09IE5VTEwpCi0gICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsKLQljaC0+dXNlciA9IE5VTEw7CS8qIHdpbGwgYmUgZnJlZWQsIGJlbG93ICovCi0gICAgfQorCQljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwkJaWYgKGNoID09IE5VTEwpCisJCQlyZXR1cm4gLUVOT0VOVDsKKwkJY2gtPnVzZXIgPSBOVUxMOwkvKiB3aWxsIGJlIGZyZWVkLCBiZWxvdyAqLworCX0KIAotICAgIGlmIChsb2NraXQpCi0gICAgICAgIHJ0bmxfdW5sb2NrICgpOyAgICAgICAgICAgICAvKiBuZWVkZWQgaWYgSW9jdGwgY2FsbGluZyBzZXF1ZW5jZSAqLwotICAgIHVucmVnaXN0ZXJfaGRsY19kZXZpY2UgKG5kZXYpOwotICAgIGlmIChsb2NraXQpCi0gICAgICAg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ByaXYgKnByaXY7CisJaW50ICAgICAgICAgaTsKIAotICAgIGZvciAoaSA9IDA7IGkgPCAxMjg7IGkrKykKLSAgICB7Ci0gICAgICAgIHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OwotICAgICAgICBjaGFyICAgICAgICBidWZbc2l6ZW9mIChDSEFOTkFNRSkgKyAzXTsKKwlmb3IgKGkgPSAwOyBpIDwgMTI4OyBpKyspIHsKKwkJc3RydWN0IG5ldF9kZXZpY2UgKm5kZXY7CisJCWNoYXIgICAgICAgIGJ1ZltzaXplb2YoQ0hBTk5BTUUpICsgM107CiAKLSAgICAgICAgc3ByaW50ZiAoYnVmLCBDSEFOTkFNRSAiJWQiLCBpKTsKLQluZGV2ID0gX19kZXZfZ2V0X2J5X25hbWUoJmluaXRfbmV0LCBidWYpOwotCWlmICghbmRldikKLQkJY29udGludWU7Ci0gICAgICAgIHByaXYgPSBkZXZfdG9faGRsYyAobmRldiktPnByaXY7CisJCXNwcmludGYoYnVmLCBDSEFOTkFNRSAiJWQiLCBpKTsKKwkJbmRldiA9IF9fZGV2X2dldF9ieV9uYW1lKCZpbml0X25ldCwgYnVmKTsKKwkJaWYgKCFuZGV2KQorCQkJY29udGludWU7CisJCXByaXYgPSBkZXZfdG9faGRsYyhuZGV2KS0+cHJpdjsKIAotICAgICAgICBpZiAoKHVuc2lnbmVkIGxvbmcpIChwcml2LT5jaSkgPT0KLSAgICAgICAgICAgICh1bnNpZ25lZCBsb25nKSAobmV0ZGV2X3ByaXYobXVzeWNjX2RldikpKQotICAgICAgICB7Ci0gICAgICAgICAgICBuZGV2LT5mbGFncyAmPSB+SUZGX1VQOwotICAgICAgICAgICAgbmV0aWZfc3RvcF9xdWV1ZSAobmRldik7Ci0gICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAxKTsKKwkJaWYgKCh1bnNpZ25lZCBsb25nKSAocHJpdi0+Y2kpID09CisJCQkodW5zaWduZWQgbG9uZykgKG5ldGRldl9wcml2KG11c3ljY19k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kKIHsKLSAgICBjaV90ICAgICAgICpjaTsKLSAgICB2b2lkICAgICAgICpkYXRhOwotICAgIGludCAgICAgICAgIGlvY21kLCBpb2xlbjsKLSAgICBzdGF0dXNfdCAgICByZXQ7Ci0gICAgc3RhdGljIHN0cnVjdCBkYXRhCi0gICAgewotICAgICAgICB1bmlvbgotICAgICAgICB7Ci0gICAgICAgICAgICB1X2ludDhfdCBjOwotICAgICAgICAgICAgdV9pbnQzMl90IGk7Ci0gICAgICAgICAgICBzdHJ1Y3Qgc2JlX2JyZF9pbmZvIGJpcDsKLSAgICAgICAgICAgIHN0cnVjdCBzYmVfZHJ2X2luZm8gZGlwOwotICAgICAgICAgICAgc3RydWN0IHNiZV9paWRfaW5mbyBpaXA7Ci0gICAgICAgICAgICBzdHJ1Y3Qgc2JlX2JyZF9hZGRyIGJhcDsKLSAgICAgICAgICAgIHN0cnVjdCBzYmVjb21fY2hhbl9zdGF0cyBzdGF0czsKLSAgICAgICAgICAgIHN0cnVjdCBzYmVjb21fY2hhbl9wYXJhbSBwYXJhbTsKLSAgICAgICAgICAgIHN0cnVjdCB0ZW11eF9jYXJkX3N0YXRzIGNhcmRzOwotICAgICAgICAgICAgc3RydWN0IHNiZWNvbV9jYXJkX3BhcmFtIGNhcmRwOwotICAgICAgICAgICAgc3RydWN0IHNiZWNvbV9mcmFtZXJfcGFyYW0gZnJwOwotICAgICAgICB9ICAgICAgICAgICB1OwotICAgIH0gICAgICAgICAgIGFyZzsKKwljaV90ICAgICAgICpjaTsKKwl2b2lkICAgICAgICpkYXRhOworCWludCAgICAgICAgIGlvY21kLCBpb2xlbjsKKwlzdGF0dXNfdCAgICByZXQ7CisJc3RhdGljIHN0cnVjdCBkYXRhIHsKKwkJdW5pb24geworCQkJdV9pbnQ4X3QgYzsKKwkJCXVfaW50MzJfdCBpOworCQkJc3RydWN0IHNiZV9icmRfaW5mbyBiaXA7CisJCQlzdHJ1Y3Qgc2JlX2Rydl9pbmZvIGRpcDsKKwkJCXN0c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dm9pZCAoKmhhbmRsZXIpKGludCwgdm9pZCAqLCBzdHJ1Y3QgcHRfcmVncyAqKSwKLSAgICAgKiAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3MsIGNvbnN0IGNoYXIgKmRldl9uYW1lLCB2b2lkICpkZXZfaWQpOwotICAgICAqICB3aGVyZWluOgotICAgICAqICBpcnEgICAgICAtPiBUaGUgaW50ZXJydXB0IG51bWJlciB0aGF0IGlzIGJlaW5nIHJlcXVlc3RlZC4KLSAgICAgKiAgaGFuZGxlciAgLT4gUG9pbnRlciB0byBoYW5kbGluZyBmdW5jdGlvbiBiZWluZyBpbnN0YWxsZWQuCi0gICAgICogIGZsYWdzICAgIC0+IEEgYml0IG1hc2sgb2Ygb3B0aW9ucyByZWxhdGVkIHRvIGludGVycnVwdCBtYW5hZ2VtZW50LgotICAgICAqICBkZXZfbmFtZSAtPiBTdHJpbmcgdXNlZCBpbiAvcHJvYy9pbnRlcnJ1cHRzIHRvIHNob3cgb3duZXIgb2YgaW50ZXJydXB0LgotICAgICAqICBkZXZfaWQgICAtPiBQb2ludGVyIChmb3Igc2hhcmVkIGludGVycnVwdCBsaW5lcykgdG8gcG9pbnQgdG8gaXRzIG93bgotICAgICAqICAgICAgICAgICAgICBwcml2YXRlIGRhdGEgYXJlYSAodG8gaWRlbnRpZnkgd2hpY2ggZGV2aWNlIGlzIGludGVycnVwdGluZykuCi0gICAgICoKLSAgICAgKiAgZXh0ZXJuIHZvaWQgZnJlZV9pcnEodW5zaWduZWQgaW50IGlycSwgdm9pZCAqZGV2X2lkKTsKLSAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJaWYgKHJlZ2lzdGVyX25ldGRldihuZGV2KSB8fAorCQkoYzRfaW5pdChjaSwgKHVfY2hhciAqKSBmMCwgKHVfY2hhciAqKSBmMSkgIT0gU0JFX0RSVlJfU1VDQ0VTUykpIHsKKwkJ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VkIGludCBpcnEsIHZvaWQgKmRldl9pZCk7CisJICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0gICAgaWYgKHJlcXVlc3RfaXJxIChpcnEwLCAmYzRfbGludXhfaW50ZXJydXB0LAotICAgICAgICAgICAgICAgICAgICAgSVJRRl9TSEFSRUQsCi0gICAgICAgICAgICAgICAgICAgICBuZGV2LT5uYW1lLCBuZGV2KSkKLSAgICB7Ci0gICAgICAgIHByX3dhcm5pbmcoIiVzOiBNVVNZQ0MgY291bGQgbm90IGdldCBpcnE6ICVkXG4iLCBuZGV2LT5uYW1lLCBpcnEwKTsKLSAgICAgICAgdW5yZWdpc3Rlcl9uZXRkZXYgKG5kZXYpOwotICAgICAgICBPU19rZnJlZSAobmV0ZGV2X3ByaXYobmRldikpOwotICAgICAgICBPU19rZnJlZSAobmRldik7Ci0gICAgICAgIGVycm9yX2ZsYWcgPSBFSU87Ci0JcmV0dXJuIE5VTEw7Ci0gICAgfQorCWlmIChyZXF1ZXN0X2lycShpcnEwLCAmYzRfbGludXhfaW50ZXJydXB0LAorCQkJSVJRRl9TSEFSRUQsCisJCQluZGV2LT5uYW1lLCBuZGV2KSkgeworCQlwcl93YXJuaW5nKCIlczogTVVTWUNDIGNvdWxkIG5vdCBnZXQgaXJxOiAlZFxuIiwKKwkJCSAgIG5kZXYtPm5hbWUsIGlycTApOworCQl1bnJlZ2lzdGVyX25ldGRldihuZGV2KTsKKwkJT1Nfa2ZyZWUobmV0ZGV2X3ByaXYobmRldikpOworCQlPU19rZnJlZShuZGV2KTsKKwkJZXJyb3JfZmxhZyA9IC1FSU87CisJCXJldHVybiBOVUxMOworCX0KICNpZmRlZiBDT05GSUdfU0JFX1BNQ0M0X05DT01NCi0gICAgaWYgKHJlcXVlc3RfaXJxIChpcnExLCAmYzRfZWJ1c19pbnRlcnJ1cHQsIElSUUZfU0hBUkVELCBuZGV2LT5uYW1lLCBuZGV2KS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ogZm9yIGxhdGVyIHVzYWdlICovCisJCS8qIGFsc28gc2V0cyBQUk9NIGZvcm1hdCB0eXBlIChwcm9tZm10KSBmb3IgbGF0ZXIgdXNhZ2UgKi8KKwkJaGR3X3NuX2dldChoaSwgYnJkbm8pOwogCi0gICAgICAgIHN3aXRjaCAoaGktPnByb21mbXQpCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMToKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUxICopIChoaS0+bWZnX2luZm8ucGZ0MS5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMjoKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTIgKikgKGhpLT5tZmdfaW5mby5wZnQyLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAg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SAgICBjaV90ICAgICAgICpjaTsKLSAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldjsKLSAgICBpbnQgICAgICAgICBpLCBqLCBrOworCWhkd19pbmZvX3QgKmhpOworCWNpX3QgICAgICAgKmNpOworCXN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworCWludCAgICAgICAgIGksIGosIGs7CiAKLSAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGhpLT5uZGV2KSAgICAgICAgICAgICAgIC8qIGEgYm9hcmQgaGFzIGJlZW4gYXR0YWNoZWQgKi8KLSAgICAgICAgewotICAgICAgICAgICAgY2kgPSAoY2lfdCAqKShuZXRkZXZfcHJpdihoaS0+bmRldikpOwotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNpLT5tYXhfcG9ydDsgaisrKQotICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBNVVNZQ0NfTkNIQU5TOyBrKyspCi0gICAgICAgICAgICAgICAgICAgIGlmICgobmRldiA9IGNpLT5wb3J0W2pdLmNoYW5ba10tPnVzZXIpKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAwKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQorCWZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspIHsKKwkJaWYgKGhpLT5uZGV2KSB7ICAgICAgICAgIC8qIGEgYm9hcmQgaGFzIGJlZW4gYXR0YWNoZWQgKi8KKwkJCWNpID0gKGNpX3QgKikobmV0ZGV2X3ByaXYoaGktPm5kZXYpKTsKKwkJCWZvciAoaiA9IDA7IGogPCBjaS0+bWF4X3BvcnQ7IGorKykKKwkJCQlmb3IgKGsgPSAwOyBrIDwgTVV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AwKSAvIDB4ODAwOwogICAgIGlmIChwb3J0bnVtID49IGNpLT5tYXhfcG9ydCkKLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogICAgIHBpID0gJmNpLT5wb3J0W3BvcnRudW1dOwogICAgIGlmIChtY3AtPm9mZnNldCA+PSAweDYwMDApCiAgICAgICAgIG9mZnNldCArPSAweDYwMDA7ICAgICAgICAgICAvKiBwdXQgYmFjayBpbiBNc2dDZmdEZXNjIGFkZHJlc3Mgb2Zmc2V0ICovCkBAIC04OTQsNyArODk1LDcgQEAKIGM0X2dldF9wb3J0IChjaV90ICpjaSwgaW50IHBvcnRudW0pCiB7CiAgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgU0RfU0VNX1RBS0UgKCZjaS0+c2VtX3dkYnVzeSwgIl93ZF8iKTsgICAgICAvKiBvbmx5IDEgdGhydSBoZXJlLCBwZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCkBAIC05MTUsNyArOTE2LDcgQEAKICAgICBpbnQgICAgICAgICBpOwogCiAgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CiAgICAgcHAgPSAmY2ktPnBvcnRbcG9ydG51bV0ucDsKQEAgLTkyNywxNSArOTI4LDE1IEBACiAgICAgICAgICAgICAgICAgcG9ydG51bSwgZTFtb2RlLCBwaS0+b3BlbmNoYW5zKTsKICAgICB9CiAgICAgaWYgKHBpLT5vcGVuY2hhbnMpCi0gICAgICAgIHJldHVybiBFQlVTWTsgICAgICAgICAgICAgICAvKiBncm91cCBuZWVkcyBpbml0aWFsaXphdGlvbiBvbmx5IGZvcgorICAgICAgICByZXR1cm4gLUVCVVNZOyAgICAgICAgICAgICAgIC8qIGdyb3VwIG5lZWRzIGluaXRpYWxpemF0aW9uIG9ubHkgZm9yCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaXJzdCBjaGFubmVsIG9mIGEgZ3JvdXAgKi8KIAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gYzRfd3FfcG9ydF9pbml0IChwaSkpKSAgICAgICAvKiBjcmVhdGUvaW5pdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd29ya3F1ZXVlX3N0cnVjdCAqLwotICAgICAgICAgICAgcmV0dXJuIHJldDsKKwlyZXQgPSBjNF93cV9wb3J0X2luaXQocGkpOworCWlmIChyZXQpICAgICAgIC8qIGNyZWF0ZS9pbml0IHdvcmtxdWV1ZV9zdHJ1Y3QgKi8KKwkJcmV0dXJuIHJldDsKICAgICB9CiAKICAgICBpbml0X2NvbWV0IChjaSwgcGktPmNvbWV0YmFzZSwgcHAtPnBvcnRfbW9kZSwgMSAvKiBjbG9ja21hc3RlciA9PSB0cnVlICovICwgcHAtPnBvcnRQKTsKQEAgLTEwMTgsMTAgKzEwMTksMTAgQEAKICAgICBpbnQgICAgICAgICBnY2hhbjsKIAogICAgIGlmIChjNF9maW5kX2NoYW4gKGNoYW5udW0pKSAgICAgLyogYSBuZXcgY2hhbm5lbCBzaG91bGRuJ3QgYWxyZWFkeSBleGlzdCAqLwotICAgICAgICByZXR1cm4gRUVYSVNUOworICAgICAgICByZXR1cm4gLUVFWElTVDsKIAogICAgIGlmIChwb3J0bnVtID49IGNpLT5tYXhfcG9ydCkgICAgLyogc2FuaXR5IGNoZWNrICovCi0gICAgICAgIHJldHVybiBFTlhJTz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VOQVNTSUdORUQ7CkBAIC0xMDk1LDggKzEwOTksOSBAQAogewogICAgIG1jaF90ICAgICAgKmNoOwogCi0gICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKLSAgICAgICAgcmV0dXJuIEVOT0VOVDsKKwljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwlpZiAoIWNoKQorCQlyZXR1cm4gLUVOT0VOVDsKIAogICAgIG1lbXNldCAoJmNoLT5zLCAwLCBzaXplb2YgKHN0cnVjdCBzYmVjb21fY2hhbl9zdGF0cykpOwogICAgIHJldHVybiAwOwpAQCAtMTEwOSwxOSArMTExNCwyMCBAQAogICAgIG1jaF90ICAgICAgKmNoOwogICAgIGludCAgICAgICAgIGksIHggPSAwOwogCi0gICAgaWYgKCEoY2ggPSBjNF9maW5kX2NoYW4gKGNoYW5udW0pKSkKLSAgICAgICAgcmV0dXJuIEVOT0VOVDsKKwljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwlpZiAoIWNoKQorCQlyZXR1cm4gLUVOT0VOVDsKIAogI2lmIDEKICAgICBpZiAoY2gtPnAuY2FyZCAhPSBwLT5jYXJkIHx8CiAgICAgICAgIGNoLT5wLnBvcnQgIT0gcC0+cG9ydCB8fAogICAgICAgICBjaC0+cC5jaGFubnVtICE9IHAtPmNoYW5udW0pCi0gICAgICAgIHJldHVybiBFSU5WQUw7CisgICAgICAgIHJldHVybiAtRUlOVkFMOwogI2VuZGlmCiAKICAgICBpZiAoIShjaC0+dXAtPmdyb3VwX2lzX3NldCkpCiAgICAgewotICAgICAgICByZXR1cm4gRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCisgICAgICAgIHJldHVybiAtRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZXF1aXJlZCBwcmlvciB0byBmaXJzdCBncm91cCdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTRVRfQ0hBTiBjb21tYW5kICovCiAgICAgfQpAQCAtMTE0MywxMCArMTE0OSwxMiBAQAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gbXVzeWNjX2NoYW5fZG93biAoKGNpX3QgKikgMCwgY2hhbm51bSkpKQotICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgaWYgKChyZXQgPSBjNF9jaGFuX3VwIChjaC0+dXAtPnVwLCBjaGFubnVtKSkpCi0gICAgICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IG11c3ljY19jaGFuX2Rvd24oKGNpX3QgKikwLCBjaGFubnVtKTsKKwlpZiAocmV0KQorCQlyZXR1cm4gcmV0OworCXJldCA9IGM0X2NoYW5fdXAoY2gtPnVwLT51cCwgY2hhbm51bSk7CisJaWYgKHJldCkKKwkJcmV0dXJuIHJldDsKICAgICAgICAgc2RfZW5hYmxlX3htaXQgKGNoLT51c2VyKTsgIC8qIHJlLWVuYWJsZSB0byBjYXRjaCBmbG93IGNvbnRyb2xsZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNoYW5uZWwgKi8KICAgICB9CkBAIC0xMTU5LDggKzExNjcsMTAgQEAKIHsKICAgICBtY2hfdCAgICAgICpjaDsKIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICAqcCA9IGNoLT5wOwogICAgIHJldHVybiAwOwogfQpAQCAtMTE3MCw4ICsxMTgwLDEwIEBACiB7CiAgICAgbWNoX3QgICAgICAqY2g7CiAKLSAgICBpZiAoIShjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSkpKQotICAgICAgICByZXR1cm4gRU5PRU5UOworCWNoID0gYzRfZmluZF9jaGFuKGNoYW5udW0pOworCWlmICghY2gpCisJCXJldHVybiAtRU5PRU5UOworCiAgICAgKnAgPSBjaC0+czsKICAgICBwLT50eF9wZW5kaW5nID0gYXRvbWljX3JlYWQgKCZjaC0+dHhfcGVuZGluZyk7CiAgICAgcmV0dXJuIDA7CkBAIC0xMjQwLDggKzEyNTIsMTAgQEAKICAgICB1X2ludDMyX3QgICB0bXA7ICAgICAgICAgICAgLyogZm9yIG9wdGltaXppbmcgY29udmVyc2lvbiBhY3Jvc3MgQkUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGxhdGZvcm0gKi8KIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICBpZiAoY2gtPnN0YXRlID09IFVQKQogICAgIHsKICAgICAgICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCkBAIC0xMjY0LDcgKzEyNzgsNyBAQAogICAgICAgICAgICAgICAgIHByX2luZm8oIisgYXNrNCAleCwgY3VycmVudGx5ICV4XG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnAuYml0bWFza1tpXSwgcGktPnRzbVtpXSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gRUlOVkFMOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CiAgICAgICAgIH0KICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKICAgICAgICAgICAgIGlmIChjaC0+cC5iaXRtYXNrW2ldICYgKDEgPDwgaikpCkBAIC0xMjc3LDcgKzEyOTEsNyBAQAogICAgICAgICAvKiBpZiggY3h0MWUxX2xvZ19sZXZlbCA+PSBMT0dfV0FSTikgICovCiAgICAgICAgIHByX2luZm8oIiVzOiBjNF9jaGFuX3VwWyVkXSBFTk9CVUZTIChubyBUaW1lU2xvdHMgYXNzaWduZWQpXG4iLAogICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBjaGFubnVtKTsKLSAgICAgICAgcmV0dXJuIEVOT0JVRlM7ICAgICAgICAgICAgIC8qIHRoaXMgc2hvdWxkIG5vdCBoYXBwZW4gKi8KKyAgICAgICAgcmV0dXJuIC1FTk9CVUZTOyAgICAgICAgICAgICAvKiB0aGlzIHNob3VsZCBub3QgaGFwcGVuICovCiAgICAgfQogICAgIGFkZHIgPSBjNF9maWZvX2FsbG9jIChwaSwgZ2NoYW4sICZuYnVmKTsKICAgICBjaC0+c3RhdGUgPSBVUDsKQEAgLTEzNzIsMTIgKzEzODYsMTMgQEAKICAgICAgICAgfQogICAgICAgICBtZC0+bmV4dCA9IGNwdV90b19sZTMyIChPU192dG9waHlzIChtZC0+c25leHQpKTsKIAotICAgICAgICAgICAgICAgaWYgKCEobSA9IE9TX21lbV90b2tlbl9hbGxvYyAoY3h0MWUxX21heF9tcnUpKSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCi0gICAgICAgICAgICAgICAgcHJfaW5mbygiJXM6IGM0X2NoYW5fdXBbJWRdIC0gdG9rZW4gYWxsb2MgZmFpbHVyZSwgc2l6ZSA9ICVkLlxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2ktPmRldm5hbWUsIGNoYW5udW0sIGN4dDFlMV9tYXhfbXJ1KTsKLSAgICAgICAgICAgIGdvdG8gZXJyZnJlZTsKKwltID0gT1NfbWVtX3Rva2VuX2FsbG9jKGN4dDFlMV9tYXhfbXJ1KTsKKwlpZiAoIW0p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+CisjaW5jbHVkZSA8bGludXgvZGV2aWNlLmg+CisjaW5jbHVkZSA8bGludXgva2Rldl90Lmg+CisjaW5jbHVkZSA8bGludXgvZmlybXdhcmUuaD4KKworI2luY2x1ZGUgImRnYXAuaCIKKworI2RlZmluZSBpbml0X01VVEVYKHNlbSkgICAgICAgICBzZW1hX2luaXQoc2VtLCAxKQorI2RlZmluZSBERUNMQVJFX01VVEVYKG5hbWUpICAgICBcCisJc3RydWN0IHNlbWFwaG9yZSBuYW1lID0gX19TRU1BUEhPUkVfSU5JVElBTElaRVIobmFtZSwgMSkKKworTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOworTU9EVUxFX0FVVEhPUigiRGlnaSBJbnRlcm5hdGlvbmFsLCBodHRwOi8vd3d3LmRpZ2kuY29tIik7CitNT0RVTEVfREVTQ1JJUFRJT04oIkRyaXZlciBmb3IgdGhlIERpZ2kgSW50ZXJuYXRpb25hbCBFUENBIFBDSSBiYXNlZCBwcm9kdWN0IGxpbmUiKTsKK01PRFVMRV9TVVBQT1JURURfREVWSUNFKCJkZ2FwIik7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIHByb3RvcyBmb3IgdGhpcyBmaWxlCisgKgorICovCisKK3N0YXRpYyBpbnQgZGdhcF9zdGFydCh2b2lkKTsKK3N0YXRpYyB2b2lkIGRnYXBfaW5pdF9nbG9iYWxzKHZvaWQpOworc3RhdGljIGludCBkZ2FwX2ZvdW5kX2JvYXJkKHN0cnVjdCBwY2lfZGV2ICpwZGV2LCBpbnQgaWQpOworc3RhdGljIHZvaWQgZGdhcF9jbGVhbnVwX2JvYXJkKHN0cnVjdCBib2FyZF90ICpicmQpOworc3RhdGljIHZvaWQgZGdhcF9wb2xsX2hhbmRsZXIodWxvbmcgZHVtbXkpOworc3RhdGljIGludCBkZ2FwX2luaXRfcGNpKHZvaWQpOworc3RhdGljIGludCB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vbGxfbG9jayk7CS8qIFBvbGwgc2NoZWR1bGluZyBsb2NrICovCitzdGF0aWMgdWxvbmcgZGdhcF9wb2xsX3RpbWU7CQkvKiBUaW1lIG9mIG5leHQgcG9sbCAqLworc3RhdGljIHVpbnQgZGdhcF9wb2xsX3N0b3A7CQkvKiBVc2VkIHRvIHRlbGwgcG9sbGVyIHRvIHN0b3AgKi8KK3N0YXRpYyBzdHJ1Y3QgdGltZXJfbGlzdCBkZ2FwX3BvbGxfdGltZXI7CisKKy8qCisgICAgIFNVUFBPUlRFRCBQUk9EVUNUUworCisgICAgIENhcmQgTW9kZWwgICAgICAgICAgICAgICBOdW1iZXIgb2YgUG9ydHMgICAgICBJbnRlcmZhY2UKKyAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICBBY2NlbGVwb3J0IFhlbSAgICAgICAgICAgNCAtIDY0ICAgICAgICAgICAgICAoRUlBMjMyICYgRUlBNDIyKQorICAgICBBY2NlbGVwb3J0IFhyICAgICAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IFhyIDkyMCAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IEMvWCAgICAgICAgICAgOCAtIDEyOCAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IEVQQy9YICAgICAgICAgOCAtIDIyNCAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IFhyLzQyMiAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBNDIyKQorICAgICBBY2NlbGVwb3J0IDJyLzkyMCAgICAgICAgMiAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IDRyLzkyMCAgICAgICAgNCAgICAgICAgICAgICAgICAgICAoRUlBMjM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bnNtb2QKKyAqIGNvbmZpZ3VyYXRpb24gdmFyaWFibGVzLiAgVGhlc2UgYXJlIGRlY2xhcmVkIG5lYXIgdGhlIGhlYWQgb2YKKyAqIHRoaXMgZmlsZS4KKyAqLworc3RhdGljIHZvaWQgZGdhcF9pbml0X2dsb2JhbHModm9pZCkKK3sKKwlpbnQgaSA9IDA7CisKKwlmb3IgKGkgPSAwOyBpIDwgTUFYQk9BUkRTOyBpKyspCisJCWRnYXBfQm9hcmRbaV0gPSBOVUxMOworCisJaW5pdF90aW1lcigmZGdhcF9wb2xsX3RpbWVyKTsKKworCWluaXRfd2FpdHF1ZXVlX2hlYWQoJmRnYXBfZGxfd2FpdCk7CisJZGdhcF9kbF9hY3Rpb24gPSAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVXRpbGl0eSBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogZGdhcF9tc19zbGVlcCgpCisgKgorICogUHV0IHRoZSBkcml2ZXIgdG8gc2xlZXAgZm9yIHggbXMncworICoKKyAqIFJldHVybnMgMCBpZiB0aW1lZCBvdXQsICEwIChzaG93aW5nIHNpZ25hbCkgaWYgaW50ZXJydXB0ZWQgYnkgYSBzaWduYWwuCisgKi8KK3N0YXRpYyBpbnQgZGdhcF9tc19zbGVlcCh1bG9uZyBtcykKK3sKKwljdXJyZW50LT5zdGF0ZSA9IFRBU0tfSU5URVJSVVBUSUJMRTsKKwlzY2hlZHVsZV90aW1lb3V0KChtcyAqIEhaKSAvIDEwMDApOworCXJldHVybiBzaWduYWxfcGVuZGluZyhjdXJyZW50KTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg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hbm5lbCBzdHJ1Y3R1cmUuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3N0YXRpYyB2b2lkIGRnYXBfaW5wdXQoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCXN0cnVjdCBic190CSpiczsKKwlzdHJ1Y3QgdHR5X3N0cnVjdCAqdHA7CisJc3RydWN0IHR0eV9sZGlzYyAqbGQ7CisJdWludAlybWFzazsKKwl1aW50CWhlYWQ7CisJdWludAl0YWlsOworCWludAlkYXRhX2xlbjsKKwl1bG9uZwlsb2NrX2ZsYWdzOworCXVsb25nICAgbG9ja19mbGFnczI7CisJaW50IGZsaXBfbGVuOworCWludCBsZW4gPSAwOworCWludCBuID0gMDsKKwl1Y2hhciAqYnVmOworCXVjaGFyIHRtcGNoYXI7CisJaW50IHMgPSAwOworCisJaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQorCQlyZXR1cm47CisKKwl0cCA9IGNoLT5jaF90dW4udW5fdHR5OworCisJYnMgID0gY2gtPmNoX2JzOworCWlmICghYnMpCisJCXJldHVybjsKKworCWJkID0gY2gtPmNoX2JkOworCWlmICghYmQgfHwgYmQtPm1hZ2ljICE9IERHQVBfQk9BUkRfTUFHSUMpCisJCXJldHVybjsKKworCXNwaW5fbG9ja19pcnFzYXZlKCZiZC0+YmRfbG9jaywgbG9ja19mbGFncyk7CisJc3Bpbl9sb2NrX2lycXNhdmUoJmNoLT5jaF9sb2NrLCBsb2NrX2ZsYWdzMik7CisKKwkvKgorCSAqICAgICAgRmlndXJlIHRoZSBudW1iZXIgb2YgY2hhcmFjdGVycyBpbiB0aGUgYnVmZmVyLgorCSAqICAgICAgRXhpdCBpbW1lZGlhdGVseSBpZiBub25lLgorCSAqLworCisJcm1hc2sgPSBjaC0+Y2hfcnNpemUgLS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ZmxlY3QgdGhlIGN1cnJlbnQgcmVhbGl0eS4KKwkgKi8KKwlpZiAodmlydF9jYXJyaWVyID09IDEpCisJCWNoLT5jaF9mbGFncyB8PSBDSF9GQ0FSOworCWVsc2UKKwkJY2gtPmNoX2ZsYWdzICY9IH5DSF9GQ0FSOworCisJaWYgKHBoeXNfY2FycmllciA9PSAxKQorCQljaC0+Y2hfZmxhZ3MgfD0gQ0hfQ0Q7CisJZWxzZQorCQljaC0+Y2hfZmxhZ3MgJj0gfkNIX0NEOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVFRZIEVudHJ5IHBvaW50cyBhbmQgaGVscGVyIGZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBkZ2FwX3R0eV9vcGVuKCkKKyAqCisgKi8KK3N0YXRpYyBpbnQgZGdhcF90dHlfb3BlbihzdHJ1Y3QgdHR5X3N0cnVjdCAqdHR5LCBzdHJ1Y3QgZmlsZSAqZmlsZSkKK3sKKwlzdHJ1Y3QgYm9hcmRfdAkqYnJkOworCXN0cnVjdCBjaGFubmVsX3QgKmNoOworCXN0cnVjdCB1bl90CSp1bjsKKwlzdHJ1Y3QgYnNfdAkqYnM7CisJdWludAkJbWFqb3IgPSAwOworCXVpbnQJCW1pbm9yID0gMDsKKwlpbnQJCXJjID0gMDsKKwl1bG9uZwkJbG9ja19mbGFnczsKKwl1bG9uZwkJbG9ja19mbGFnczI7CisJdTE2CQloZWFkOworCisJcmMgPSAwOworCisJbWFqb3IgPSBNQUpPUih0dHlfZGV2bnVtKHR0eSkpOworCW1pbm9yID0gTUlOT1IodHR5X2Rldm51bSh0dHkpKTsKKworCWlmIChtYWpvciA+IDI1NSkKKwkJcmV0dXJuIC1FTlhJTzsKKworCS8qIEd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0byB0aGUgRkVQLiAgIElmIHRoZSB0aW1lIHNwZW50IHdhaXRpbmcKKwkgKiBpcyBvdXRsYW5kaXNoLCBkZWNsYXJlIHRoZSBGRVAgZGVhZC4KKwkgKi8KKwlmb3IgKGNvdW50ID0gZGdhcF9jb3VudCA7OykgeworCisJCWhlYWQgPSByZWFkdygmKGNtX2FkZHItPmNtX2hlYWQpKTsKKwkJdGFpbCA9IHJlYWR3KCYoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWR3IC0gU2VuZHMgYSAxIHdvcmQgY29tbWFuZCB0byB0aGUgRkVQLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBjbWQgICAgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIHdvcmQgICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgd29yZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIG5jbWRzICAgLSBXYWl0IHVudGlsIG5jbWRzIG9yIGZld2VyIGNtZHMgYXJlIGxlZnQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGNtZCBidWZmZXIgYmVmb3JlIHJldHVybmluZy4KKyAqCisgKj09PT09PT09P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OworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWR3X2V4dCAtIFNlbmRzIGEgZXh0ZW5kZWQgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCisgKgorICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgorICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAorICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGdhcF9jbWR3X2V4dChzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdTE2IGNtZCwgdTE2IHdvcmQsIHVpbnQgbmNtZHMpCit7CisJY2hhcgkJKnZhZGRyID0gTlVMTDsKKwlzdHJ1Y3QgY21fdAkqY21fYWRkciA9IE5VTEw7CisJdWludAkJY291bnQ7CisJdWludAkJbjsKKwl1MTYJCWhlYWQ7CisJdTE2CQl0YWlsOworCisJaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQorCQlyZXR1cm47CisKKwkvKgorCSAqIENoZWNrIGlmIGJvYXJkIGlzIHN0aWxsIGFsaXZlLgorCSAqLworCWlmIChjaC0+Y2hfYmQtPnN0YXRlID09IEJPQVJEX0ZBS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yo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF93bW92ZSAtIFdyaXRlIGRhdGEgdG8gRkVQIGJ1ZmZlci4KKyAqCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKiAgICAgICAgICAgICAgYnVmICAgICAtIFBvaXRlciB0byBjaGFyYWN0ZXJzIHRvIGJlIG1vdmVkLgorICogICAgICAgICAgICAgIGNudCAgICAgLSBOdW1iZXIgb2YgY2hhcmFjdGVycyB0byBtb3ZlLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGdhcF93bW92ZShzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgY2hhciAqYnVmLCB1aW50IGNudCkKK3sKKwlpbnQgICAgbjsKKwljaGFyICAgKnRhZGRyOworCXN0cnVjdCBic190ICAgICpiczsKKwl1MTYgICAgaGVhZDsKKworCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUdJQykKKwkJcmV0dXJuOworCisJLyoKKwkgKiBDaGVjayBwYXJhbWV0ZXJzLgorCSAqLworCWJzICAgPSBjaC0+Y2hfYnM7CisJaGVhZCA9IHJlYWR3KCYoYnMtPnR4X2hlYWQpKTsKKworCS8qCisJICogSWYgcG9pbnRlcnMgYXJlIG91dCBvZiByYW5nZSwganVzdCByZXR1cm4uCisJICovCisJaWYgKChjbnQgPiBjaC0+Y2hfdHNpemUpIHx8CisJICAgICh1bnNpZ25lZCkoaGVhZCAtIGNoLT5jaF90c3RhcnQpID49IGNoLT5jaF90c2l6ZSkKKwkJcmV0dXJuOworCisJLyoKKwkgKiBJZiB0aGUgd3JpdGUgd3JhcHMgb3ZlciB0aG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0+Y2hfZmVwY2ZsYWcgPSAwOworCWNoLT5jaF9mZXBvZmxhZyA9IDA7CisJY2gtPmNoX2ZlcHN0YXJ0YyA9IDA7CisJY2gtPmNoX2ZlcHN0b3BjID0gMDsKKwljaC0+Y2hfZmVwYXN0YXJ0YyA9IDA7CisJY2gtPmNoX2ZlcGFzdG9wYyA9IDA7CisJY2gtPmNoX21vc3RhdCA9IDA7CisJY2gtPmNoX2hmbG93ID0gMDsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9wYXJhbSAtIFNldCBEaWdpIHBhcmFtZXRlcnMuCisgKgorICogICAgICAgICAgICAgIHN0cnVjdCB0dHlfc3RydWN0ICogICAgIC0gVFRZIGZvciBwb3J0LgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIGludCBkZ2FwX3BhcmFtKHN0cnVjdCB0dHlfc3RydWN0ICp0dHkpCit7CisJc3RydWN0IGt0ZXJtaW9zICp0czsKKwlzdHJ1Y3QgYm9hcmRfdCAqYmQ7CisJc3RydWN0IGNoYW5uZWxfdCAqY2g7CisJc3RydWN0IGJzX3QgICAqYnM7CisJc3RydWN0IHVuX3QgICAqdW47CisJdTE2CWhlYWQ7CisJdTE2CWNmbGFnOworCXUxNglpZmxhZzsKKwl1Y2hhcgltdmFsOworCXVjaGFyCWhmbG93OworCisJaWYgKCF0dHkgfHwgdHR5LT5tYWdpYyAhPSBUVFlfTUFHSUMpCisJCXJldHVybiAtRU5YSU87CisKKwl1biA9IChzdHJ1Y3QgdW5fdCAqKSB0dHktPmRyaXZlcl9kYXRhOworCWlmICghdW4gfHwgdW4tPm1hZ2ljICE9IERHQVBfVU5JVF9NQUdJQykKKwkJcmV0dXJuIC1FTlhJTzsKKworCWNoID0gdW4tP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qIFlvdSBzaG91bGQgaGF2ZSByZWNlaXZlZCBhIGNvcHkgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlCisgKiBhbG9uZyB3aXRoIHRoaXMgcHJvZ3JhbTsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0d2FyZQorICogRm91bmRhdGlvbiwgSW5jLiwgNjc1IE1hc3MgQXZlLCBDYW1icmlkZ2UsIE1BIDAyMTM5LCBVU0EuCisgKgorICoJTk9URTogVEhJUyBJUyBBIFNIQVJFRCBIRUFERVIuIERPIE5PVCBDSEFOR0UgQ09ESU5HIFNUWUxFISEhCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBEcml2ZXIgaW5jbHVkZXMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworI2lmbmRlZiBfX0RHQVBfRFJJVkVSX0gKKyNkZWZpbmUgX19ER0FQX0RSSVZFUl9ICisKKyNpbmNsdWRlIDxsaW51eC90eXBlcy5oPiAgICAgICAgLyogVG8gcGljayB1cCB0aGUgdmFyaW9ucyBMaW51eCB0eXBlcyAqLworI2luY2x1ZGUgPGxpbnV4L3R0eS5oPiAgICAgICAgICAvKiBUbyBwaWNrIHVwIHRoZSB2YXJpb3VzIHR0eSBzdHJ1Y3RzL2RlZmluZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4gICAgLyogRm9yIGlycXJldHVybl90IHR5cGUgKi8KKworI2lmbmRlZiBUUlVFCisjIGRlZmluZSBUUlVFIDEKKyNlbmRpZgorCisjaWZuZGVmIEZBTFNFCisjIGRlZmluZSBGQUxTRSAwCisjZW5kaWYKKworLyogUmVxdWlyZWQgZm9yIG91ciBzaGFyZWQgaGVhZGVycyEgKi8KK3R5cGVkZWYgdW5zaWduZWQgY2hhcgkJdWNoYXI7CisKKyNpZiAhZGVmaW5lZChUVFlfRkxJUEJVRl9TSVpFKQorIyBkZWZpbmUgVFRZX0ZMSVBCVUZfU0laRSA1MTIKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIERyaXZlciBkZWZpbmVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBEcml2ZXIgaWRlbnRpZmljYXRpb24KKyAqLworI2RlZmluZQlER19OQU1FCQkiZGdhcC0xLjMtMTYiCisjZGVmaW5lCURHX1BBUlQJCSI0MDAwMjM0N19DIgorI2RlZmluZQlEUlZTVFIJCSJkZ2FwIgorCisvKgorICogZGVmaW5lcyBmcm9tIGRnYXBfcGNpLmgKKyAqLyAKKyNkZWZpbmUgUENJTUFYIDMyCQkJLyogbWF4aW11bSBudW1iZXIgb2YgUENJIGJvYXJkcyAqLworCisjZGVmaW5lIERJR0lfVklECQkweDExNEYKKworI2RlZmluZSBQQ0lfREVWX0VQQ19ESUQJCTB4MDAwMgorI2RlZmluZSBQQ0lfREVWX1hFTV9ESUQJCTB4MDAwNAorI2RlZmluZSBQQ0lfREVWX1hSX0RJRAkJMHgwMDA1CisjZGVmaW5lIFBDSV9ERVZfQ1hfRElECQkweDAwMDYKKyNkZWZpbmUgUENJX0RFVl9YUkpfRElECQkweDAwMDkJLyogUExYLWJhc2VkIFhyIGFkYXB0ZXIgKi8KKyNkZWZpbmUgUENJX0RFVl9YUl9JQk1fRElECTB4MDAxMQkvKiBJQk0gOC1wb3J0IEFzeW5jIEFkYXB0ZXIgKi8KKyNkZWZpbmUgUENJX0RFVl9YUl9CVUxMX0RJRAkweDAwMTMJLyogQlVMTCA4LXBvcnQgQXN5bmMgQWRhcH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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIEZFUCBtZW1vcnkgb2Zmc2V0cworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1RBUlQgICAgICAgICAgIDB4MDAwNEwgICAgICAgICAvKiBFeGVjdXRpb24gc3RhcnQgYWRkcmVzcyAgICAgICovCisKKyNkZWZpbmUgQ01EQlVGICAgICAgICAgIDB4MGQxMEwgICAgICAgICAvKiBDb21tYW5kIChjbV90KSBzdHJ1Y3R1cmUgb2Zmc2V0ICovCisjZGVmaW5lIENNRFNUQVJUICAgICAgICAweDA0MDBMICAgICAgICAgLyogU3RhcnQgb2YgY29tbWFuZCBidWZmZXIgICAgICAqLworI2RlZmluZSBDTURNQVggICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIEVuZCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICAgKi8KKworI2RlZmluZSBFVkJVRiAgICAgICAgICAgMHgwZDE4TCAgICAgICAgIC8qIEV2ZW50IChldl90KSBzdHJ1Y3R1cmUgICAgICAgKi8KKyNkZWZpbmUgRVZTVEFSVCAgICAgICAgIDB4MDgwMEwgICAgICAgICAvKiBTdGFydCBvZiBldmVudCBidWZmZXIgICAgICAgICovCisjZGVmaW5lIEVWTUFYICAgICAgICAgICAweDBjMDBMICAgICAgICAgLyogRW5kIG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgICAqLworI2RlZmluZSBGRVA1X1BMVVMgICAgICAgMHgwRTQwICAgICAgICAgIC8qIEFTQ0lJICc1JyBhbmQgQVNDSUkgJ0EnIGlzIGhlcmUgICovCisjZGVmaW5lIEVDU19TRUcgICAgICAgICAweDBFNDQgICAgICAgICAgLyogU2VnbWVudCBvZiB0aGUgZXh0ZW5kZWQgY2hhbm5lbCBzdHJ1Y3R1cmUgKi8KKyNkZWZpbmUgTElORV9TUEVFRCAgICAgIDB4MTAgICAgICAgICAgICAvKiBPZmZzZXQgaW50byBFQ1NfU0VHIGZvciBsaW5lIHNwZWVkICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZmVwIGhhcyBleHRlbmRlZCBjYXBhYmlsaXRpZXMgKi8KKworLyogQklPUyBNQUdJQyBTUE9UUyAqLworI2RlZmluZSBFUlJPUiAgICAgICAgICAgMHgwQzE0TAkJLyogQklPUyBlcnJvciBjb2RlICAgICAgICAgICAgICAqLworI2RlZmluZSBTRVFVRU5DRQkweDBDMTJMCQkvKiBCSU9TIHNlcXVlbmNlIGluZGljYXRvciAgICAgICovCisjZGVmaW5lIFBPU1RBUkVBCTB4MEMwMEwJCS8qIFBPU1QgY29tcGxldGUgbWVzc2FnZSBhcmVhICAgKi8KKworLyogRkVQIE1BR0lDIFNQT1RTICovCisjZGVmaW5lIEZFUFNUQVQgICAgICAgICBQT1NUQVJFQSAgICAgICAgLyogT1MgaGVyZSB3aGVuIEZFUCBjb21lcyB1cCAgICAqLworI2RlZmluZSBOQ0hBTiAgICAgICAgICAgMHgwQzAyTCAgICAgICAgIC8qIG51bWJlciBvZiBwb3J0cyBGRVAgc2VlcyAgICAgKi8KKyNkZWZpbmUgUEFOSUMgICAgICAgICAgIDB4MEMxMEwgICAgICAgICAvKiBQQU5JQyBhcmVhIGZvciBGRVAgICAgICAgICAgICovCisjZGVmaW5lIEtNRU1FTSAgICAgICAgICAweDBDMzBMICAgICAgICAgLyogTWVtb3J5IGZvciBLTUUgdXNlICAgICAgICAgICAqLworI2RlZmluZSBDT05GSUcgICAgICAgICAgMHgwQ0QwTCAgICAgICAgIC8qIENvbmNlbnRyYXRvciBjb25maWd1cmF0aW9uIGluZm8gKi8KKyNkZWZpbmUgQ09ORklHU0laRSAgICAgIDB4MDAzMCAgICAgICAgICAvKiBjb25maWd1cmF0aW9uIGluZm8gc2l6ZSAgICAgICovCisjZGVmaW5lIERPV05SRVEgICAg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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBFdmVudCBmbGFncy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIElGQlJFQUsgICAgICAgICAweDAxICAgICAgICAgICAgLyogQnJlYWsgcmVjZWl2ZWQgICAgICAgICAgICAgICAqLworI2RlZmluZSBJRlRMVyAgICAgICAgICAgMHgwMiAgICAgICAgICAgIC8qIFRyYW5zbWl0IGxvdyB3YXRlciAgICAgICAgICAgKi8KKyNkZWZpbmUgSUZURU0gICAgICAgICAgIDB4MDQgICAgICAgICAgICAvKiBUcmFuc21pdHRlciBlbXB0eSAgICAgICAgICAgICovCisjZGVmaW5lIElGREFUQSAgICAgICAgICAweDA4ICAgICAgICAgICAgLyogUmVjZWl2ZSBkYXRhIHByZXNlbnQgICAgICAgICAqLworI2RlZmluZSBJRk1PREVNICAgICAgICAgMHgyMCAgICAgICAgICAgIC8qIE1vZGVtIHN0YXR1cyBjaGFuZ2UgICAgICAgICAgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBNb2RlbSBmbGFncworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgICAgICAgZGVmaW5lICBETV9SVFMgICAgICAgICAgMHgwMiAgICAvKiBSZXF1ZXN0IHRvIHNlbmQgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fQ0QgICAgICAgICAgIDB4ODAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RTUiAgICAgICAgICAweDIwICAgIC8qIERhdGEgc2V0IHJlYWR5ICAgICAgICAgICAgICAgKi8KKyMgICAgICAgZGVmaW5lICBETV9DVFMgICAgICAgICAgMHgxMCAgICAvKiBDbGVhciB0byBzZW5kICAgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fUkkgICAgICAgICAgIDB4NDAgICAgLyogUmluZyBpbmRpY2F0b3IgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RUUiAgICAgICAgICAweDAxICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICAgICAgICAgKi8KKworLyoKKyAqIGRlZmluZXMgZnJvbSBkZ2FwX2NvbmYuaAorICovCisjZGVmaW5lIE5VTExOT0RFIDAJCS8qIGhlYWRlciBub2RlLCBub3QgdXNlZCAqLworI2RlZmluZSBCTk9ERSAxCQkJLyogQm9hcmQgbm9kZSAqLworI2RlZmluZSBMTk9ERSAyCQkJLyogTGluZSBub2RlICovCisjZGVmaW5lIENOT0RFIDMJCQkvKiBDb25jZW50cmF0b3Igbm9kZSAqLworI2RlZmluZSBNTk9ERSA0CQkJLyogRUJJIE1vZHVsZSBub2RlICovCisjZGVmaW5lIFROT0RFIDUJCQkvKiB0dHkgbmFtZSBwcmVmaXggbm9kZSAqLworI2RlZmluZQlDVU5PREUgNgkJLyogY3UgbmFtZSBwcmVmaXggKG5vbi1TQ08pICovCisjZGVmaW5lIFBOT0RFIDcJCQkvKiB0cmFucy4gcHJpbnQgcHJlZml4IG5vZGUgKi8KKyNkZWZpbmUgSk5PREUgOAkJCS8qIG1hSm9yIG51bWJlciBub2RlICovCisjZGVmaW5lIEFOT0RFIDkJCQkvKiBhbHRwaW4gKi8KKyNkZWZpbmUJVFNOT0RFIDEwCQkvKiB0dHkgc3RydWN0dXJlIHNpemUgKi8KKyNkZWZpbmUgQ1NOT0RFIDExCQkvKiBjaGFubmVsIHN0cnVjdHVyZSBzaXplICovCisjZGVmaW5lIEJTTk9ERSAxMgkJLyogYm9hcmQgc3RydWN0dXJlIHNpemUgKi8KKyNkZWZp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UkkgICAgICAgICAgIC8qIFJpbmcgaW5kaWNhdG9yICAgICAgICovCisjZGVmaW5lIERfRFRSKGNoKSAgICAgICBETV9EVFIgICAgICAgICAgLyogRGF0YSB0ZXJtaW5hbCByZWFkeSAgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFN0cnVjdHVyZXMgYW5kIGNsb3NlbHkgcmVsYXRlZCBkZWZpbmVzLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qCisgKiBBIHN0cnVjdHVyZSB0byBob2xkIGEgc3RhdGlzdGljcyBjb3VudGVyLiAgV2UgYWxzbworICogY29tcHV0ZSBtb3ZpbmcgYXZlcmFnZXMgZm9yIHRoaXMgY291bnRlci4KKyAqLworc3RydWN0IG1hY291bnRlciB7CisJdTMyCQljbnQ7CS8qIFRvdGFsIGNvdW50ICovCisJdWxvbmcJCWFjY3VtOwkvKiBBY3V1bXVsYXRvciBwZXIgcGVyaW9kICovCisJdWxvbmcJCXNtYTsJLyogU2ltcGxlIG1vdmluZyBhdmVyYWdlICovCisJdWxvbmcJCWVtYTsJLyogRXhwb25lbnRpYWwgbW92aW5nIGF2ZXJhZ2UgKi8KK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRGV2aWNlIGZsYWcgZGVmaW5pdGlvbnMgZm9yIGJkX2ZsYWdzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJQkRfRkVQNVBMVVMJMHgwMDAxICAgICAgICAgIC8qIFN1cHBvcnRzIEZFUDUgUGx1cyBjb21tYW5kcyAqLworI2RlZm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0FJVAkweDAwMjAJCS8qIFByaW50ZXIgd2FpdGluZyBmb3IgdGVybWluYWwJKi8KKyNkZWZpbmUgVU5fVElNRQkJMHgwMDQwCQkvKiBXYWl0aW5nIG9uIHRpbWUJCSovCisjZGVmaW5lIFVOX0VNUFRZCTB4MDA4MAkJLyogV2FpdGluZyBvdXRwdXQgcXVldWUgZW1wdHkJKi8KKyNkZWZpbmUgVU5fTE9XCQkweDAxMDAJCS8qIFdhaXRpbmcgb3V0cHV0IGxvdyB3YXRlciBtYXJrKi8KKyNkZWZpbmUgVU5fRVhDTF9PUEVOCTB4MDIwMAkJLyogT3BlbiBmb3IgZXhjbHVzaXZlIHVzZQkqLworI2RlZmluZSBVTl9XT1BFTgkweDA0MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX1dJT0NUTAkweDA4MDAJCS8qIERldmljZSB3YWl0aW5nIGZvciBvcGVuCSovCisjZGVmaW5lIFVOX0hBTkdVUAkweDgwMDAJCS8qIENhcnJpZXIgbG9zdAkJCSovCisKK3N0cnVjdCBkZXZpY2U7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFN0cnVjdHVyZSBmb3IgdGVybWluYWwgb3IgcHJpbnRlciB1bml0LgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCB1bl90IHsKKwlpbnQJbWFnaWM7CQkvKiBVbml0IE1hZ2ljIE51bWJlci4JCQkqLworCXN0cnVjdAljaGFubmVsX3QgKnVuX2NoOworCXUzMgl1bl90aW1lOworCXUzMgl1bl90eXBlOworCXUzMgl1bl9vcGVuX2NvdW50OwkvKiBDb3VudGVyIG9mIG9wZW5zIHRvIHBvcnQJCSovCisJc3RydWN0IHR0eV9zdHJ1Y3QgKnVuX3R0eTsvKiBQb2ludGVyIHRvIHVuaXQgdHR5IHN0cnVjdHVyZQkqLworCXUzMgl1bl9mbGFnczsJLyogVW5pdCBmbGFncwkJCQkqLworCXdhaXRfcXVldWVfaGVhZF90IHVuX2ZsYWdzX3dhaXQ7IC8qIFBsYWNlIHRvIHNsZWVwIHRvIHdhaXQgb24gdW5pdCAqLworCXUzMgl1bl9kZXY7CQkvKiBNaW5vciBkZXZpY2UgbnVtYmVyCQkJKi8KKwl0Y2ZsYWdfdCB1bl9vZmxhZzsJLyogb2ZsYWdzIGJlaW5nIGRvbmUgb24gYm9hcmQJCSovCisJdGNmbGFnX3QgdW5fbGZsYWc7CS8qIGxmbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLworCXN0cnVjdCBkZXZpY2UgKnVuX3N5c2ZzOworfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBEZXZpY2UgZmxhZyBkZWZpbml0aW9ucyBmb3IgY2hfZmxhZ3MuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBDSF9QUk9OICAgICAgICAgMHgwMDAxICAgICAgICAgIC8qIFByaW50ZXIgb24gc3RyaW5nICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX09VVCAgICAgICAgICAweDAwMDIgICAgICAgICAgLyogRGlhbC1vdXQgZGV2aWNlIG9wZW4gICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfU1RPUCAgICAgICAgIDB4MDAwNCAgICAgICAgICAvKiBPdXRwdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDSF9TVE9QSSAgICAgICAgMHgwMDA4ICAgICAgICAgIC8qIElucHV0IGlzIHN0b3BwZWQgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX0NEICAgICAgICAgICAweDAwMTAgICAgICAgICAgLyogQ2FycmllciBpcyBwcmVzZW50ICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfRkNBUiAgICAgICAgIDB4MDAyMCAgICAgICAgICAvKiBDYXJyaWVyIGZvcmNlZCBvbiAgICAgICAgICAgICAgICAqLworCisjZGVmaW5lIENIX1JYQkxPQ0sgICAgICAweDAwODAgICAgICAgICAgLyogRW5hYmxlIHJ4IGJsb2NrZWQgZmxhZyAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfV0xPVyAgICAgICAgIDB4MDEwMCAgICAgICAgICAvKiBUZXJtIHdhaXRpbmcgbG93IGV2ZW50ICAgICAgICAgICAqLworI2RlZmluZSBDSF9XRU1QVFkgICAgICAgMHgwMjAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBlbXB0eSBldmVudCAgICAgICAgICovCisjZGVmaW5lIENIX1JFTkFCTEUgICAgICAweDA0MDAgICAgICAgICAgLyogQnVmZmVyIGp1c3QgZW1wdGllZCAgICAgICAgICAqLworI2RlZmluZSBDSF9SQUNUSVZFICAgICAgMHgwODAwICAgICAgICAgIC8qIFByb2Nlc3MgYWN0aXZlIGluIHh4cmVhZCgpICAgKi8KKyNkZWZpbmUgQ0hfUldBSVQgICAgICAgIDB4MTAwMCAgICAgICAgICAvKiBQcm9jZXNzIHdhaXRpbmcgaW4geHhyZWFkKCkgICovCisjZGVmaW5lIENIX0JBVUQwCTB4MjAwMAkJLyogVXNlZCBmb3IgY2hlY2tpbmcgQjAgdHJhbnNpdGlvbnMgKi8KKyNkZWZpbmUgQ0hfSEFOR1VQICAgICAgIDB4ODAwMAkJLyogSGFuZ3VwIHJlY2VpdmVkICAgICAgICAgICAgICAgICAgKi8KKworLyoKKyAqIERlZmluaXRpb25zIGZvciBjaF9zbmlmZl9mbGFncworICovCisjZGVmaW5lIFNOSUZGX09QRU4JMHgxCisjZGVmaW5lIFNOSUZGX1dBSVRfREFUQQkweDIKKyNkZWZpbmUgU05JRkZfV0FJVF9TUEFDRSAweDQKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKioqCURlZmluaXRpb25zIGZvciBEaWdpIGRpdHR5KDEpIGNvbW1hbmQuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIG1vZHVsZSBwcm92aWRlcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc3BlY2lhbCBEaWdpCisgKiBzZXJpYWwgbGluZSBlbmhhbmNlbWVudHMgd2hpY2ggYXJlIG5vdCBzdGFuZGFyZCBVTklYKHRtKSBmZWF0dXJlcy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZiAhZGVmaW5lZChUSU9DTU9ERykKKworI2RlZmluZQlUSU9DTU9ERwkoKCdkJzw8OCkgfCAyNTApCQkvKiBnZXQgbW9kZW0gY3RybCBzdGF0ZQkqLworI2RlZmluZQlUSU9DTU9EUwkoKCdkJzw8OCkgfCAyNTEpCQkvKiBzZXQgbW9kZW0gY3RybCBzdGF0ZQkqLworCisjaWZuZGVmIFRJT0NNX0xFCisjZGVmaW5lCQlUSU9DTV9MRQkweDAxCQkvKiBsaW5lIGVuYWJsZQkJKi8KKyNkZWZpbmUJCVRJT0NNX0RUUgkweDAyCQkvKiBkYXRhIHRlcm1pbmFsIHJlYWR5CSovCisjZGVmaW5lCQlUSU9DTV9SVFMJMHgwNAkJLyogcmVxdWVzdCB0byBzZW5kCSovCisjZGVmaW5lCQlUSU9DTV9TVAkweDA4CQkvKiBzZWNvbmRhcnkgdHJhbnNtaXQJKi8KKyNkZWZpbm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8qIDIyMDAgZmxvdyBzdGF0dXMgbWFzayAgICAqLworI2RlZmluZQlSQ1ZEX0ZYT0ZGCTB4MDEJCQkvKiAyeDM2IFRlcm1pbmFsIFhPRkYgcmN2ZCAgKi8KKyNkZWZpbmUJUkNWRF9QWE9GRgkweDAyCQkJLyogMngzNiBQcmludGVyIFhPRkYgcmN2ZCAgICovCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVmFsdWVzIGZvciBkaWdpX2ZsYWdzCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBESUdJX0lYT04JMHgwMDAxCQkvKiBIYW5kbGUgSVhPTiBpbiB0aGUgRkVQCSovCisjZGVmaW5lIERJR0lfRkFTVAkweDAwMDIJCS8qIEZhc3QgYmF1ZCByYXRlcwkJKi8KKyNkZWZpbmUgUlRTUEFDRQkJMHgwMDA0CQkvKiBSVFMgaW5wdXQgZmxvdyBjb250cm9sCSovCisjZGVmaW5lIENUU1BBQ0UJCTB4MDAwOAkJLyogQ1RTIG91dHB1dCBmbG93IGNvbnRyb2wJKi8KKyNkZWZpbmUgRFNSUEFDRQkJMHgwMDEwCQkvKiBEU1Igb3V0cHV0IGZsb3cgY29udHJvbAkqLworI2RlZmluZSBEQ0RQQUNFCQkweDAwMjAJCS8qIERDRCBvdXRwdXQgZmxvdyBjb250cm9sCSovCisjZGVmaW5lIERUUlBBQ0UJCTB4MDA0MAkJLyogRFRSIGlucHV0IGZsb3cgY29udHJvbAkqLworI2RlZmluZSBESUdJX0NPT0sJMHgwMDgwCQkvKiBDb29rZWQgcHJvY2Vzc2luZyBkb25lIGluIEZFUCAqLworI2RlZmluZSBESUdJX0ZPUkNFRENECTB4MDEwMAkJLyogRm9yY2UgY2FycmllcgkJKi8KKyNkZWZpbmUJRElHSV9BTFRQSU4JMHgwMjAwCQkvKiBBbHRlcm5hdGUgUkotNDUgcGluIGNvbmZpZwkqLworI2RlZmluZQlESUdJX0FJWE9OCTB4MDQwMAkJLyogQXV4IGZsb3cgY29udHJvbCBpbiBmZXAJKi8KKyNkZWZpbmUJRElHSV9QUklOVEVSCTB4MDgwMAkJLyogSG9sZCBwb3J0IG9wZW4gZm9yIGZsb3cgY250cmwqLworI2RlZmluZSBESUdJX1BQX0lOUFVUCTB4MTAwMAkJLyogQ2hhbmdlIHBhcmFsbGVsIHBvcnQgdG8gaW5wdXQqLworI2RlZmluZSBESUdJX0RUUl9UT0dHTEUgMHgyMDAwCQkvKiBTdXBwb3J0IERUUiBUb2dnbGUJCSovCisjZGVmaW5lCURJR0lfNDIyCTB4NDAwMAkJLyogZm9yIDQyMi8yMzIgc2VsZWN0YWJsZSBwYW5lbCAqLworI2RlZmluZSBESUdJX1JUU19UT0dHTEUJMHg4MDAwCQkvKiBTdXBwb3J0IFJUUyBUb2dnbGUJCSovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoZXNlIG9wdGlvbnMgYXJlIG5vdCBzdXBwb3J0ZWQgb24gdGhlIGNvbXhpLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJRElHSV9DT01YSQkoRElHSV9GQVNUfERJR0lfQ09PS3xEU1JQQUNFfERDRFBBQ0V8RFRSUEFDRSkKKworI2RlZmluZSBESUdJX1BMRU4JMjgJCS8qIFN0cmluZyBsZW5ndGgJCSovCisjZGVmaW5lCURJR0lfVFNJWgkxMAkJLyogVGVybWluYWwgc3RyaW5nIGxlbgkJKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RydWN0dXJlIHVzZWQgd2l0aCBpb2N0bCBjb21tYW5kcyBmb3IgRElHSSBwYXJhbWV0ZXJzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBkaWdpX3QgeworCXVuc2lnbmVkIHNob3J0CWRpZ2lfZmxhZ3M7CQkvKiBGbGFncyAoc2VlIGFib3ZlKQkqLworCXVuc2lnbmVkIHNob3J0CWRpZ2lfbWF4Y3BzOwkJLyogTWF4IHByaW50ZXIgQ1BTCSovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjaGFyOwkJLyogTWF4IGNoYXJzIGluIHByaW50IHF1ZXVlICovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9idWZzaXplOwkJLyogQnVmZmVyIHNpemUJCSovCisJdW5zaWduZWQgY2hhcglkaWdpX29ubGVuOwkJLyogTGVuZ3RoIG9mIE9OIHN0cmluZwkqLworCXVuc2lnbmVkIGNoYXIJZGlnaV9vZmZsZW47CQkvKiBMZW5ndGggb2YgT0ZGIHN0cmluZwkqLworCWNoYXIJCWRpZ2lfb25zdHJbRElHSV9QTEVOXTsJLyogUHJpbnRlciBvbiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX29mZnN0cltESUdJX1BMRU5dOwkvKiBQcmludGVyIG9mZiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX3Rlcm1bRElHSV9UU0laXTsJLyogdGVybWluYWwgc3RyaW5nCSovCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBLTUUgZGVmaW5pdGlvbnMgYW5kIHN0cnVjdHVyZXMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZQlSV19JRExFCQkwCS8qIE9wZXJh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CXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9pbml0OwkvKiBOb24tWmVybyBpZiBpdCBjYXVzZWQgYW4KKwkJCQkJCSAgIHh4aW5pdCBjYWxsLiAqLworCisJdW5zaWduZWQgY2hhcglzaHJpbmtfYnVmX2FucG9ydHM7CS8qIE51bWJlciBvZiBhc3luYyBwb3J0cyAgKi8KKwl1bnNpZ25lZCBjaGFyCXNocmlua19idWZfc25wb3J0czsgCS8qIE51bWJlciBvZiBzeW5jICBwb3J0cyAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl90eXBlOwkvKiBCb2FyZCB0eXBlIDEgPSBQQy9YaSwKKwkJCQkJCQkgICAgICAyID0gUEMvWG0sCisJCQkJCQkJICAgICAgMyA9IFBDL1hlCisJCQkJCQkJICAgICAgNCA9IE1DL1hpCisJCQkJCQkJICAgICAgNSA9IENPTVgvaSAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9jYXJkOwkvKiBDYXJkIG51bWJlciAqLworCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdG8gZ2V0IGRyaXZlciBzdGF0dXMgaW5mb3JtYXRpb24KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9kaW5mbyB7CisJdW5zaWduZWQgbG9uZwlkaW5mb19uYm9hcmRzOwkJLyogIyBib2FyZHMgY29uZmlndXJlZAkqLworCWNoYXIJCWRpbmZvX3Jlc2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KKwljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KK307CisKKyNkZWZpbmUJRElHSV9HRVRERAkoKCdkJzw8OCkgfCAyNDgpCQkvKiBnZXQgZHJpdmVyIGluZm8gICAgICAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItYm9hcmQgaW5mb3JtYXRpb24KKyAqCisgKiBwaHlzc2l6ZSBhbmQgbWVtc2l6ZSBkaWZmZXIgd2hlbiBib2FyZCBoYXMgIndpbmRvd2VkIiBtZW1vcnkKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9pbmZvIHsKKwl1bnNpZ25lZCBsb25nCWluZm9fYmRudW07CQkvKiBCb2FyZCBudW1iZXIgKDAgYmFzZWQpICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19pb3BvcnQ7CQkvKiBpbyBwb3J0IGFkZHJlc3MgICAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19waHlzYWRkcjsJCS8qIG1lbW9yeSBhZGRyZXNzICAgICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3BoeXNzaXplOwkJLyogU2l6ZSBvZiBob3N0IG1lbSB3aW5kb3cgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fbWVtc2l6ZTsJCS8qIEFtb3VudCBvZiBkdWFsLXBvcnQgbWVtICovCisJCQkJCQkvKiBvbiBib2FyZCAgICAgICAgICAgICAgICAqLworCXVuc2lnbmVkIHNob3J0CWluZm9fYmR0eXBlOwkJLyogQm9hcmQgdHlwZSAgICAgICAgICAgICAgKi8KKwl1bnNpZ25lZCBzaG9ydAlpbmZvX25wb3J0czsJCS8qIG51bWJlciBvZiBwb3J0cyAgICAgICAgICovCisJY2hhcgkJaW5mb19iZHN0YXRlOwkJLyogYm9hcmQgc3RhdGUgICAgIC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AgICAgKCgnZCc8PDgpIHwgMjU0KQkJLyogY2hhbmdlIHBvbGxlciByYXRlICAgKi8KKworI2RlZmluZSBESUdJX1NFVENVU1RPTUJBVUQJX0lPVygnZScsIDEwNiwgaW50KQkvKiBTZXQgaW50ZWdlciBiYXVkIHJhdGUgKi8KKyNkZWZpbmUgRElHSV9HRVRDVVNUT01CQVVECV9JT1IoJ2UnLCAxMDcsIGludCkJLyogR2V0IGludGVnZXIgYmF1ZCByYXRlICovCisjZGVmaW5lIERJR0lfUkVTRVRfUE9SVAkJKCgnZSc8PDgpIHwgOTMpCQkvKiBSZXNldCBwb3J0CQkqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBDaGFubmVsIGluZm9ybWF0aW9uIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgY2hhbm5lbF90IHsKKwlpbnQgbWFnaWM7CQkJLyogQ2hhbm5lbCBNYWdpYyBOdW1iZXIJCSovCisJc3RydWN0IGJzX3QJKmNoX2JzOwkJLyogQmFzZSBzdHJ1Y3R1cmUgcG9pbnRlciAgICAgICAqLworCXN0cnVjdCBjbV90CSpjaF9jbTsJCS8qIENvbW1hbmQgcXVldWUgcG9pbnRlciAgICAgICAgKi8KKwlzdHJ1Y3QgYm9hcmRfdCAqY2hfYmQ7CQkvKiBCb2FyZCBzdHJ1Y3R1cmUgcG9pbnRlciAgICAgICovCisJdW5zaWduZWQgY2hhciAqY2hfdmFkZHI7CS8qIEZFUCBtZW1vcnkgb3JpZ2luICAgICAgICAgICAgKi8KKwl1bnNpZ25lZCBjaGFyICpjaF90YWRkcjsJLyogV3JpdGUgYnVmZmVyIG9yaWdpbiAgICAgICAgICAqLworCXVuc2lnbmVkIGNoYXIgKmNoX3JhZGRyOwkvKiBSZ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ICAgICAqLworCXVpbnQJY2hfY3VzdG9tX3NwZWVkOwkvKiBDdXN0b20gYmF1ZCwgaWYgc2V0CQkqLworCXVpbnQJY2hfYmF1ZF9pbmZvOwkJLyogQ3VycmVudCBiYXVkIGluZm8gZm9yIC9wcm9jIG91dHB1dAkqLworCXVsb25nCWNoX3J4Y291bnQ7CQkvKiB0b3RhbCBvZiBkYXRhIHJlY2VpdmVkIHNvIGZhcgkqLworCXVsb25nCWNoX3R4Y291bnQ7CQkvKiB0b3RhbCBvZiBkYXRhIHRyYW5zbWl0dGVkIHNvIGZhcgkqLworCXVsb25nCWNoX2Vycl9wYXJpdHk7CQkvKiBDb3VudCBvZiBwYXJpdHkgZXJyb3JzIG9uIGNoYW5uZWwJKi8KKwl1bG9uZwljaF9lcnJfZnJhbWU7CQkvKiBDb3VudCBvZiBmcmFtaW5nIGVycm9ycyBvbiBjaGFubmVsCSovCisJdWxvbmcJY2hfZXJyX2JyZWFrOwkJLyogQ291bnQgb2YgYnJlYWtzIG9uIGNoYW5uZWwJKi8KKwl1bG9uZwljaF9lcnJfb3ZlcnJ1bjsJCS8qIENvdW50IG9mIG92ZXJydW5zIG9uIGNoYW5uZWwJKi8KKworCXVpbnQgY2hfc25pZmZfaW47CisJdWludCBjaF9zbmlmZl9vdXQ7CisJY2hhciAqY2hfc25pZmZfYnVmOwkJLyogU25pZmYgYnVmZmVyIGZvciBwcm9jICovCisJdWxvbmcgY2hfc25pZmZfZmxhZ3M7CQkvKiBDaGFubmVsIGZsYWdzICAgICAgICAgICAgICAgICovCisJd2FpdF9xdWV1ZV9oZWFkX3QgY2hfc25pZmZfd2FpdDsKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIENvbW1hbmQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGNtX3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRXZlbnQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGV2X3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRG93bmxvYWQgYnVmZmVyIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZG93bmxkX3QgeworCXVjaGFyCWRsX3R5cGU7CQkvKiBIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICovCisJdWNoYXIJZGxfc2VxOwkJCS8qIERvd25sb2FkIHNlcXVlbmNlICAgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc3JldjsJCS8qIFNvZnR3YXJlIHJldmlzaW9uIG51bWJlciAgICAgKi8KKwl1c2hvcnQJZGxfbHJldjsJCS8qIExvdyByZXZpc2lvbiBudW1iZXIgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfaHJldjsJCS8qIEhpZ2ggcmV2aXNpb24gbnVtYmVyICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2VnOwkJCS8qIFN0YXJ0IHNlZ21lbnQgYWRkcmVzcyAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2l6ZTsJCS8qIE51bWJlciBvZiBieXRlcyB0byBkb3dubG9hZCAgKi8KKwl1Y2hhcglkbF9kYXRhWzEwMjRdOwkJLyogRG93bmxvYWQgZGF0YSAgICAgICAgICAgICAgICAqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFcgPSByZWFkIHdyaXRlICAgICAgICBSID0gcmVhZCBvbmx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIEMgPSBjaGFuZ2VkIGJ5IGNvbW1hbmRzIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFUgPSB1bmtub3duIChtYXkgYmUgY2hhbmdlZCB3L28gbm90aWNlKSAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBic190IHsKKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdHBfam1wOwkvKiBUcmFuc21pdCBwb2xsIGp1bXAJCSAqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0Y19qbXA7CS8qIENvb2tlZCBwcm9jZWR1cmUganVtcAkgKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgcmlfam1wOwkvKiBOb3QgY3VycmVudGx5IHVzZWQJCSAqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICBycF9qbXA7CS8qIFJlY2VpdmUgcG9sbCBqdW1wCQkgKi8KKworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0eF9zZWc7CS8qIFcgIFR4IHNlZ21lbnQJICovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgIHR4X2hlYWQ7CS8qIFcgIFR4IGJ1ZmZlciBoZWFkIG9mZnNldAkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0eF90YWlsOwkvKiBSICBUeCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdHhfbWF4OwkvKiBXICBUeCBidWZmZXIgc2l6ZSAtIDEJICovCisKKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9yd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ZXh0W107Ci0KLQotLyogCi0gKiBNb2RlbSBsaW5lIGNvbnN0YW50cyBhcmUgZGVmaW5lZCBhcyBtYWNyb3MgYmVjYXVzZSBEU1IgYW5kCi0gKiBEQ0QgYXJlIHN3YXBhYmxlIHVzaW5nIHRoZSBkaXR0eSBhbHRwaW4gb3B0aW9uLgotICovCi0jZGVmaW5lIERfQ0QoY2gpICAgICAgICBjaC0+Y2hfY2QgICAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgKi8KLSNkZWZpbmUgRF9EU1IoY2gpICAgICAgIGNoLT5jaF9kc3IgICAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAqLwotI2RlZmluZSBEX1JUUyhjaCkgICAgICAgRE1fUlRTICAgICAgICAgIC8qIFJlcXVlc3QgdG8gc2VuZCAgICAgICovCi0jZGVmaW5lIERfQ1RTKGNoKSAgICAgICBETV9DVFMgICAgICAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgKi8KLSNkZWZpbmUgRF9SSShjaCkgICAgICAgIERNX1JJICAgICAgICAgICAvKiBSaW5nIGluZGljYXRvciAgICAgICAqLwotI2RlZmluZSBEX0RUUihjaCkgICAgICAgRE1fRFRSICAgICAgICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiBTdHJ1Y3R1cmVzIGFuZCBjbG9zZWx5IHJlbGF0ZWQgZGVmaW5lcy4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKgotICogQSBzdHJ1Y3R1cmUgdG8gaG9sZCBhIHN0YXRpc3RpY3MgY291bnRlci4gIFdlIGFsc28KLSAqIGNvbXB1dGUgbW92aW5nIGF2ZXJhZ2VzIGZvciB0aGlzIGNvdW50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CS8qIG9mbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLwotCXRjZmxhZ190IHVuX2xmbGFnOwkvKiBsZmxhZ3MgYmVpbmcgZG9uZSBvbiBib2FyZAkJKi8KLQlzdHJ1Y3QgZGV2aWNlICp1bl9zeXNmczsKLX07Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAqIERldmljZSBmbGFnIGRlZmluaXRpb25zIGZvciBjaF9mbGFncy4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIENIX1BST04gICAgICAgICAweDAwMDEgICAgICAgICAgLyogUHJpbnRlciBvbiBzdHJpbmcgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfT1VUICAgICAgICAgIDB4MDAwMiAgICAgICAgICAvKiBEaWFsLW91dCBkZXZpY2Ugb3BlbiAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9TVE9QICAgICAgICAgMHgwMDA0ICAgICAgICAgIC8qIE91dHB1dCBpcyBzdG9wcGVkICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIENIX1NUT1BJICAgICAgICAweDAwMDggICAgICAgICAgLyogSW5wdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfQ0QgICAgICAgICAgIDB4MDAxMCAgICAgICAgICAvKiBDYXJyaWVyIGlzIHByZXNlbnQgICAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9GQ0FSICAgICAgICAgMHgwMDIwICAgICAgICAgIC8qIENhcnJpZXIgZm9yY2VkIG9uICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgQ0hfUlhCTE9DSyAgICAgIDB4MDA4MCAgICAgICAgICAvKiBFbmFibGUgcnggYmxvY2tlZCBmbGFnICAgICAgICAgICAqLwotI2RlZmluZSBDSF9XTE9XICAgICAgICAgMHgwMTAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBsb3cgZXZlbnQgICAgICAgICAgICovCi0jZGVmaW5lIENIX1dFTVBUWSAgICAgICAweDAyMDAgICAgICAgICAgLyogVGVybSB3YWl0aW5nIGVtcHR5IGV2ZW50ICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfUkVOQUJMRSAgICAgIDB4MDQwMCAgICAgICAgICAvKiBCdWZmZXIganVzdCBlbXB0aWVkICAgICAgICAgICovCi0jZGVmaW5lIENIX1JBQ1RJVkUgICAgICAweDA4MDAgICAgICAgICAgLyogUHJvY2VzcyBhY3RpdmUgaW4geHhyZWFkKCkgICAqLwotI2RlZmluZSBDSF9SV0FJVCAgICAgICAgMHgxMDAwICAgICAgICAgIC8qIFByb2Nlc3Mgd2FpdGluZyBpbiB4eHJlYWQoKSAgKi8KLSNkZWZpbmUgQ0hfQkFVRDAJMHgyMDAwCQkvKiBVc2VkIGZvciBjaGVja2luZyBCMCB0cmFuc2l0aW9ucyAqLwotI2RlZmluZSBDSF9IQU5HVVAgICAgICAgMHg4MDAwCQkvKiBIYW5ndXAgcmVjZWl2ZWQgICAgICAgICAgICAgICAgICAqLwotCi0vKgotICogRGVmaW5pdGlvbnMgZm9yIGNoX3NuaWZmX2ZsYWdzCi0gKi8KLSNkZWZpbmUgU05JRkZfT1BFTgkweDEKLSNkZWZpbmUgU05JRkZfV0FJVF9EQVRBCTB4MgotI2RlZmluZSBTTklGRl9XQUlUX1NQQUNFIDB4NAotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKiBDaGFubmVsIGluZm9ybWF0aW9uIHN0cnVjdHVyZS4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgY2hhbm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cF9pbnRlcnJ1cHRpYmxlKCZiZC0+c3RhdGVfd2FpdCk7Ci0JfQotCi0JREdBUF9VTkxPQ0soYmQtPmJkX2xvY2ssIGxvY2tfZmxhZ3MpOwotfQotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqCi0gKiAgICAgIGRnYXBfY21kYiAtIFNlbmRzIGEgMiBieXRlIGNvbW1hbmQgdG8gdGhlIEZFUC4KLSAqCi0gKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCi0gKiAgICAgICAgICAgICAgY21kICAgICAtIENvbW1hbmQgdG8gYmUgc2VudC4KLSAqICAgICAgICAgICAgICBieXRlMSAgIC0gSW50ZWdlciBjb250YWluaW5nIGZpcnN0IGJ5dGUgdG8gYmUgc2VudC4KLSAqICAgICAgICAgICAgICBieXRlMiAgIC0gSW50ZWdlciBjb250YWluaW5nIHNlY29uZCBieXRlIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAotICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgotICoKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBkZ2FwX2NtZGIoc3RydWN0IGNoYW5uZWxfdCAqY2gsIHVjaGFyIGNtZCwgdWNoYXIgYnl0ZTEsIHVjaGFyIGJ5dGUyLCB1aW50IG5jbWRzKQotewotCWNoYXIJCSp2YWRkciA9IE5VTEw7Ci0Jc3RydWN0IGNtX3QJKmNtX2FkZHIgPSBOVUxMOwotCXVpbnQJCWNvdW50OwotCXVpbnQJCW47Ci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LF9fRklMRV9fLCBfX0xJTkVfXykpOwotCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKLQkJCXJldHVybjsKLQkJfQotCQl1ZGVsYXkoMTApOwotCX0KLX0KLQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKgotICogICAgICBkZ2FwX2NtZHcgLSBTZW5kcyBhIDEgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAotICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgotICoKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBkZ2FwX2NtZHcoc3RydWN0IGNoYW5uZWxfdCAqY2gsIHVjaGFyIGNtZCwgdTE2IHdvcmQsIHVpbnQgbmNtZHMpCi17Ci0JY2hhcgkJKnZhZGRyID0gTlVMTDsKLQlzdHJ1Y3QgY21fdAkqY21fYWRkciA9IE5VTEw7Ci0JdWludAkJY291bnQ7Ci0JdWludAkJbjsKLQl1MTYJCWhlYWQ7Ci0JdTE2CQl0YWlsOwotCi0JaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQotCQlyZXR1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N0cnVjdCBjbV90KSkKLQkJCWJyZWFrOwotCi0JCWlmICgtLWNvdW50ID09IDApIHsKLQkJCURQUl9DT1JFKCgiJXM6JWQgRmFpbGluZyBib2FyZC5cbiIsX19GSUxFX18sIF9fTElORV9fKSk7Ci0JCQljaC0+Y2hfYmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOwotCQkJcmV0dXJuOwotCQl9Ci0JCXVkZWxheSgxMCk7Ci0JfQotfQotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqCi0gKiAgICAgIGRnYXBfd21vdmUgLSBXcml0ZSBkYXRhIHRvIEZFUCBidWZmZXIuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGJ1ZiAgICAgLSBQb2l0ZXIgdG8gY2hhcmFjdGVycyB0byBiZSBtb3ZlZC4KLSAqICAgICAgICAgICAgICBjbnQgICAgIC0gTnVtYmVyIG9mIGNoYXJhY3RlcnMgdG8gbW92ZS4KLSAqCi0gKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLXZvaWQgZGdhcF93bW92ZShzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgY2hhciAqYnVmLCB1aW50IGNudCkKLXsKLQlpbnQgICAgbjsKLQljaGFyICAgKnRhZGRyOwotCXN0cnVjdCBic190ICAgICpiczsKLQl1MTYgICAgaGVhZDsKLQotCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUdJQykKLQkJcmV0dXJuOwotCi0JLyoKLQkgKiBDaGVjayBwYXJhbWV0ZXJzLgotCSAqLwotCWJzICAgPSBjaC0+Y2hfYnM7Ci0JaGVhZCA9IHJlYWR3KCYoYnMtPnR4X2hlYW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nQgZGVmaW5pdGlvbnMKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19ER0FQX0ZFUDVfSAotI2RlZmluZSBfX0RHQVBfRkVQNV9ICi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgRkVQIG1lbW9yeSBvZmZzZXRzCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZSBTVEFSVCAgICAgICAgICAgMHgwMDA0TCAgICAgICAgIC8qIEV4ZWN1dGlvbiBzdGFydCBhZGRyZXNzICAgICAgKi8KLQotI2RlZmluZSBDTURCVUYgICAgICAgICAgMHgwZDEwTCAgICAgICAgIC8qIENvbW1hbmQgKGNtX3QpIHN0cnVjdHVyZSBvZmZzZXQgKi8KLSNkZWZpbmUgQ01EU1RBUlQgICAgICAgIDB4MDQwMEwgICAgICAgICAvKiBTdGFydCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICovICAgCi0jZGVmaW5lIENNRE1BWCAgICAgICAgICAweDA4MDBMICAgICAgICAgLyogRW5kIG9mIGNvbW1hbmQgYnVmZmVyICAgICAgICAqLwotCi0jZGVmaW5lIEVWQlVGICAgICAgICAgICAweDBkMThMICAgICAgICAgLyogRXZlbnQgKGV2X3QpIHN0cnVjdHVyZSAgICAgICAqLwotI2RlZmluZSBFVlNUQVJUICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIFN0YXJ0IG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgKi8KLSNkZWZpbmUgRVZNQVggICAgICAgICAgIDB4MGMwMEwgICAgICAgICAvKiBFbmQgb2YgZXZlbnQgYnVmZmVyICAgICAgICAgICovCi0jZGVmaW5lIEZFUDVfUExVUyA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VyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBFdmVudCBzdHJ1Y3R1cmUgZGVmaW5pdGlvbi4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgZXZfdCB7Ci0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfaGVhZDsJLyogQ29tbWFuZCBidWZmZXIgaGVhZCBvZmZzZXQJKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl90YWlsOwkvKiBDb21tYW5kIGJ1ZmZlciB0YWlsIG9mZnNldAkqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X3N0YXJ0OwkvKiBzdGFydCBvZmZzZXQgb2YgYnVmZmVyCSovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfbWF4OwkJLyogbGFzdCBvZmZzZXQgb2YgYnVmZmVyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBEb3dubG9hZCBidWZmZXIgc3RydWN0dXJlLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBkb3dubGRfdCB7Ci0JdWNoYXIJZGxfdHlwZTsJCS8qIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1Y2hhcglkbF9zZXE7CQkJLyogRG93bmxvYWQgc2VxdWVuY2UgICAgICAgICAgICAqLwotCXVzaG9ydAlkbF9zcmV2OwkJLyogU29mdHdhcmUgcmV2aXNpb24gbnVtYmVyICAgICAqLwotCXVzaG9ydAlkbF9scmV2OwkJLyogTG93IHJldmlzaW9uIG51bWJlciAgICAgICAgICAqLwotCXVzaG9ydAlkbF9ocmV2OwkJLyogSGlnaCByZXZpc2lvbiBudW1iZXIgICAgICAgICAqLwotCXVzaG9ydAlkbF9zZWc7CQkJLyogU3RhcnQgc2VnbWVudCBhZGRyZXNzICAgICAgICAqLwotCXVzaG9ydAlkbF9zaXplOwkJLyogTnVtYmVyIG9mIGJ5dGVzIHRvIGRvd25sb2FkICAqLwotCXVjaGFyCWRsX2RhdGFbMTAyNF07CQkvKiBEb3dubG9hZCBkYXRhICAgICAgICAgICAgICAgICovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCi0gKiAgICAgICAgVyA9IHJlYWQgd3JpdGUgICAgICAgIFIgPSByZWFkIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAotICogICAgICAgIEMgPSBjaGFuZ2VkIGJ5IGNvbW1hbmRzIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKLSAqICAgICAgICBVID0gdW5rbm93biAobWF5IGJlIGNoYW5nZWQgdy9vIG5vdGljZSkgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgYnNfdCB7Ci0J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JCSovCi0jZGVmaW5lIFNQSU5URkMJCTB4ZmMJCS8qIFJlc2VydmVkCQkJKi8KLSNkZWZpbmUgU0NPTU1PREUJMHhmZAkJLyogU2V0IFJTMjMyLzQyMiBtb2RlCQkqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKglNb2RlcyBmb3IgU0NPTU1PREUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIE1PREVfMjMyCTB4MDAKLSNkZWZpbmUgTU9ERV80MjIJMHgwMQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKiAgICAgIEV2ZW50IGZsYWdzLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNkZWZpbmUgSUZCUkVBSyAgICAgICAgIDB4MDEgICAgICAgICAgICAvKiBCcmVhayByZWNlaXZlZCAgICAgICAgICAgICAgICovICAKLSNkZWZpbmUgSUZUTFcgICAgICAgICAgIDB4MDIgICAgICAgICAgICAvKiBUcmFuc21pdCBsb3cgd2F0ZXIgICAgICAgICAgICovCi0jZGVmaW5lIElGVEVNICAgICAgICAgICAweDA0ICAgICAgICAgICAgLyogVHJhbnNtaXR0ZXIgZW1wdHkgICAgICAgICAgICAqLwotI2RlZmluZSBJRkRBVEEgICAgICAgICAgMHgwOCAgICAgICAgICAgIC8qIFJlY2VpdmUgZGF0YSBwcmVzZW50ICAgICAgICAgKi8KLSNkZWZpbmUgSUZNT0RFTSAgICAgICAgIDB4MjAgICAgICAgICAgICAvKiBNb2RlbSBzdGF0dXMgY2hhbmdlICAgICAgICAgICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogICAKLSAqICAgICAgTW9kZW0gZmxhZ3MKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jICAgICAgIGRlZmluZSAgRE1fUlRTICAgICAgICAgIDB4MDIgICAgLyogUmVxdWVzdCB0byBzZW5kICAgICAgICAgICAgICAqLwotIyAgICAgICBkZWZpbmUgIERNX0NEICAgICAgICAgICAweDgwICAgIC8qIENhcnJpZXIgZGV0ZWN0ICAgICAgICAgICAgICAgKi8KLSMgICAgICAgZGVmaW5lICBETV9EU1IgICAgICAgICAgMHgyMCAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAgICAgICAgICovCi0jICAgICAgIGRlZmluZSAgRE1fQ1RTICAgICAgICAgIDB4MTAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgICAgICAgICAqLwotIyAgICAgICBkZWZpbmUgIERNX1JJICAgICAgICAgICAweDQwICAgIC8qIFJpbmcgaW5kaWNhdG9yICAgICAgICAgICAgICAgKi8KLSMgICAgICAgZGVmaW5lICBETV9EVFIgICAgICAgICAgMHgwMSAgICAvKiBEYXRhIHRlcm1pbmFsIHJlYWR5ICAgICAgICAgICovCi0KLQotI2VuZGlmCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZGdhcC9kZ2FwX2tjb21wYXQuaCBiL2RyaXZlcnMvc3RhZ2luZy9kZ2FwL2RnYXBfa2NvbXBhdC5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwZGMyNDA0Li4wMDAwMDAwCi0tLSBhL2RyaXZlcnMvc3RhZ2luZy9kZ2FwL2RnYXBfa2NvbXBhdC5oCisrKyAvZGV2L251bGwKQEAgLTEsNjQgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAyMDA0IERpZ2kgSW50ZXJu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0dHkpOwotCi0JRFBSX0lPQ1RMKCgiZGdhcF90dHlfZmx1c2hfYnVmZmVyIGZpbmlzaFxuIikpOwotfQotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogVGhlIElPQ1RMIGZ1bmN0aW9uIGFuZCBhbGwgb2YgaXRzIGhlbHBlcnMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBkZ2FwX3R0eV9pb2N0bCgpCi0gKgotICogVGhlIHVzdWFsIGFzc29ydG1lbnQgb2YgaW9jdGwncwotICovCi1zdGF0aWMgaW50IGRnYXBfdHR5X2lvY3RsKHN0cnVjdCB0dHlfc3RydWN0ICp0dHksIHVuc2lnbmVkIGludCBjbWQsCi0JCXVuc2lnbmVkIGxvbmcgYXJnKQotewotCXN0cnVjdCBib2FyZF90ICpiZDsKLQlzdHJ1Y3QgY2hhbm5lbF90ICpjaDsKLQlzdHJ1Y3QgdW5fdCAqdW47Ci0JaW50IHJjOwotCXUxNgloZWFkID0gMDsKLQl1bG9uZyAgIGxvY2tfZmxhZ3MgPSAwOwotCXVsb25nICAgbG9ja19mbGFnczIgPSAwOwotCXZvaWQgX191c2VyICp1YXJnID0gKHZvaWQgX191c2VyICopIGFyZzsKLQotCWlmICghdHR5IHx8IHR0eS0+bWFnaWMgIT0gVFRZX01BR0lDKQotCQlyZXR1cm4gKC1FTk9ERVYpOwotCi0JdW4gPSB0dHktPmRyaXZlcl9kYXRhOwotCWlmICghdW4gfHwgdW4tPm1hZ2ljICE9IERHQVBfVU5JVF9NQUdJQykKLQkJcmV0dXJuICgtRU5PREVWKTsKLQotCWNoID0gdW4tPnVuX2NoOwotCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUd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VyCQkqLwotI2RlZmluZQlESUdJX0FMVFBJTgkweDAyMDAJCS8qIEFsdGVybmF0ZSBSSi00NSBwaW4gY29uZmlnCSovCi0jZGVmaW5lCURJR0lfQUlYT04JMHgwNDAwCQkvKiBBdXggZmxvdyBjb250cm9sIGluIGZlcAkqLwotI2RlZmluZQlESUdJX1BSSU5URVIJMHgwODAwCQkvKiBIb2xkIHBvcnQgb3BlbiBmb3IgZmxvdyBjbnRybCovCi0jZGVmaW5lIERJR0lfUFBfSU5QVVQJMHgxMDAwCQkvKiBDaGFuZ2UgcGFyYWxsZWwgcG9ydCB0byBpbnB1dCovCi0jZGVmaW5lIERJR0lfRFRSX1RPR0dMRSAweDIwMDAJCS8qIFN1cHBvcnQgRFRSIFRvZ2dsZQkJKi8KLSNkZWZpbmUJRElHSV80MjIJMHg0MDAwCQkvKiBmb3IgNDIyLzIzMiBzZWxlY3RhYmxlIHBhbmVsICovCi0jZGVmaW5lIERJR0lfUlRTX1RPR0dMRQkweDgwMDAJCS8qIFN1cHBvcnQgUlRTIFRvZ2dsZQkJKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogVGhlc2Ugb3B0aW9ucyBhcmUgbm90IHN1cHBvcnRlZCBvbiB0aGUgY29teGkuCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZQlESUdJX0NPTVhJCShESUdJX0ZBU1R8RElHSV9DT09LfERTUlBBQ0V8RENEUEFDRXxEVFJQQUNFKQotCi0jZGVmaW5lIERJR0lfUExFTgkyOAkJLyogU3RyaW5nIGxlbmd0aAkJKi8KLSNkZWZpbmUJRElHSV9UU0laCTEwCQkvKiBUZXJtaW5hbCBzdHJpbmcgbGVuCQkqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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c2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KLQljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KLX07Ci0KLSNkZWZpbmUJRElHSV9HRVRERAkoJ2QnPDw4KSB8IDI0OAkJLyogZ2V0IGRyaXZlciBpbmZvICAgICAgKi8KLSAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFN0cnVjdHVyZSB1c2VkIHdpdGggaW9jdGwgY29tbWFuZHMgZm9yIHBlci1ib2FyZCBpbmZvcm1hdGlvbgotICoKLSAqIHBoeXNzaXplIGFuZCBtZW1zaXplIGRpZmZlciB3aGVuIGJvYXJkIGhhcyAid2luZG93ZWQiIG1lbW9yeQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBkaWdpX2luZm8gewotCXVuc2lnbmVkIGxvbmcJaW5mb19iZG51bTsJCS8qIEJvYXJkIG51bWJlciAoMCBiYXNlZCkgICovCi0JdW5zaWduZWQgbG9uZwlpbmZvX2lvcG9ydDsJCS8qIGlvIHBvcnQgYWRkcmVzcyAgICAgICAgICovCi0JdW5zaWduZWQgbG9uZwlpbmZvX3BoeXNhZGRyOwkJLyogbWVtb3J5IGFkZHJlc3MgICAgICAgICAgKi8KLQl1bnNpZ25lZCBsb25nCWluZm9fcGh5c3NpemU7CQkvKiBTaXplIG9mIGhvc3QgbWVtIHdpbmRvdyAqLwotCXVuc2lnbmVkIGxvbmcJaW5mb19tZW1zaXplOwkJLyogQW1vdW50IG9mIGR1YWwtcG9ydCBtZW0gKi8KLQkJCQkJCS8qIG9uIGJvYXJkICAgICAgICAgICAgICAgICovCi0JdW5zaWduZWQgc2hvcnQJaW5mb19iZHR5cGU7CQkvKiBCb2FyZ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Fib290L1JFQURNRQpAQCAtMCwwICsxLDcxIEBACis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KK0xpbnV4IERyaXZlciBTb3VyY2UgZm9yIFhpbGlueCBGUEdBIGZpcm13YXJlIGRvd25sb2FkCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCitUQUJMRSBPRiBDT05URU5UUy4KKworMS4gIFNVTU1BUlkKKzIuICBCQUNLR1JPVU5ECiszLiAgREVTSUdOCis0LiAgSE9XIFRPIFVTRQorNS4gIFJFRkVSRU5DRQorCisxLiBTVU1NQVJZCisKKwktIERvd25sb2FkIFhpbGlueCBGUEdBIGZpcm13YXJlCisJLSBUaGlzIG1vZHVsZSBkb3dubG9hZHMgWGlsaW54IEZQR0EgZmlybXdhcmUgdXNpbmcgZ3BpbyBwaW5zLgorCisyLiBCQUNLR1JPVU5ECisKKwlBbiBGUEdBIChGaWVsZCBQcm9ncmFtbWFibGUgR2F0ZSBBcnJheSkgaXMgYSBwcm9ncmFtbWFibGUgaGFyZHdhcmUgdGhhdCBpcworCXVzZWQgaW4gdmFyaW91cyBhcHBsaWNhdGlvbnMuIEhhcmR3YXJlIGRlc2lnbiBuZWVkcyB0byBwcm9ncmFtbWVkIHRocm91Z2gKKwlhIGRlZGljYXRlZCBkZXZpY2Ugb3IgQ1BVIGFzc2lzdGVkIHdheSAoc2VyaWFsIG9yIHBhcmFsbGVsKS4KKwlUaGlzIGRyaXZlciBwcm92aWRlcyBhIHdheSB0byBkb3dubG9hZCBGUEdBIGZpcm13YXJlLgorCiszLiBERVNJR04KKworCS0gbG9hZCBYaWxpbnggRlBHQSBiaXRzdHJlYW0gZm9ybWF0WzFdIGZpcm13YXJlIGltYWdlIGZpbGUgdXNpbmcgCisJICBrZXJuZWwgZmlybXdhcmUgZnJh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mVyZW50IEkvTyBjb25maWcKKyAqLworaW50IHhsX2luaXRfaW8odm9pZCkKK3sKKwlzdHJ1Y3QgZGV2aWNlX25vZGUgKm5wOworCWNvbnN0IHUzMiAqcF9yZWc7CisJaW50IHJlZywgY250OworCisJY250ID0gMDsKKwltZW1zZXQoJmdidXMsIDAsIHNpemVvZihzdHJ1Y3QgZ3Bpb2J1cykpOworCWZvcl9lYWNoX2NvbXBhdGlibGVfbm9kZShucCwgTlVMTCwgImZzbCxxb3JpcS1ncGlvIikgeworCQlwX3JlZyA9IG9mX2dldF9wcm9wZXJ0eShucCwgInJlZyIsIE5VTEwpOworCQlpZiAocF9yZWcgPT0gTlVMTCkKKwkJCWJyZWFrOworCQlyZWcgPSAoaW50KSAqcF9yZWc7CisJCWdidXMucltjbnRdID0gb2ZfaW9tYXAobnAsIDApOworCisJCWlmICghZ2J1cy5yW2NudF0pIHsKKwkJCXByX2Vycigibm90IGZpbmRkaW5nIGdwaW8gY2VsbC1pbmRleCAlZFxuIiwgY250KTsKKwkJCXJldHVybiAtRU5PREVWOworCQl9CisJCWNudCsrOworCX0KKwltcGM4NXh4X2dwaW9fc2V0X2RpcigwLCAweDAwMDJCRkZGLCAweDAwMDJCRkZGKTsKKwltcGM4NXh4X2dwaW9fc2V0X2RpcigxLCAweDAwMjQwMDYwLCAweDAwMjQwMDYwKTsKKworCWdidXMubmdwaW8gPSBjbnQ7CisKKwlyZXR1cm4gMDsKK30KKworCisjZWxzZQkvKiBwbGFjZWhvbGRlciBmb3IgYm9hcmRzIHdpdGggZGlmZmVyZW50IGNvbmZpZyAqLworCit2b2lkIHhsX3Byb2dyYW1fYihpbnQzMl90IGkpCit7CisJcmV0dXJuOworfQorCit2b2lkIHhsX3Jkd3JfYihpbnQzMl90IGkpCit7CisJcmV0dXJuOworfQorCit2b2lkIHhsX2NzaV9iKGludDMyX3QgaSkKK3sKKwlyZXR1cm47Cit9CisKK2ludCB4bF9nZXRfaW5pdF9iKHZvaWQpCit7CisJcm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ICAgICAgICB9LAotCXsgTElORTZfQklUX1BPRFNUVURJT19VWDEsICJQT0RTdHVkaW9VWDEiLCAgIlBPRCBTdHVkaW8gVVgxIiwgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7IExJTkU2X0JJVF9QT0RTVFVESU9fVVgyLCAiUE9EU3R1ZGlvVVgyIiwgICJQT0QgU3R1ZGlvIFVYMiIsICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfUE9EWDMsICAgICAgICAgIlBPRFgzIiwgICAgICAgICAiUE9EIFgzIiwgICAgICAgICAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgTElORTZfQklUX1BPRFgzTElWRSwgICAgICJQT0RYM0xpdmUiLCAgICAgIlBPRCBYMyBMaXZlIiwgICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7IExJTkU2X0JJVF9QT0RYVCwgICAgICAgICAiUE9EeHQiLCAgICAgICAgICJQT0R4dCIsICAgICAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU9OIH0sCi0JeyBMSU5FNl9CSVRfUE9EWFRMSVZFLCAgICAgIlBPRHh0TGl2ZSIsICAgICAiUE9EeHQgTGl2ZSIsICAgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAotCXsgTElORTZfQklUX1BPRFhUUFJPLCAgICAgICJQT0R4dFBybyIsICAgICAgIlBPRHh0IFBybyIsICAgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKLQl7IExJTkU2X0JJVF9UT05FUE9SVF9HWCwgICAiVG9uZVBvcnRHWCIsICAgICJUb25lUG9ydCBHWCIsICAgICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfVE9ORVBPUlRfVVgxLCAgIlRvbmVQb3J0VVgxIiwgICAiVG9uZVBvcnQgVVgxIiwgIC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X3ZhbGlkID0gMDsKKz4gKyAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworPiArICAgICAgICAgICAgIH0gICAKKz4gKyAgICAgfQorCitBbnlib2R5IGV2ZXJ5IGhlYXJkIG9mIG1lbWNtcCBvciBiYWNtcCBhbmQgQkRBRERSX0FOWT8KKworPiArICAgICAgICAgICAgIGlmIChub3RfdmFsaWQpIHsKKz4gKyAgICAgICAgICAgICAgICAgICAgIGRldl9pbmZvKGluZm8tPmRldiwgIlZhbGlkIGJsdWV0b290aCBhZGRyZXNzIG5vdCBmb3VuZCwiCis+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBzZXR0aW5nIHNvbWUgcmFuZG9tXG4iKTsKKz4gKyAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gYWRkcmVzcyBpcyBub3QgdmFsaWQsIHVzZSBzb21lIHJhbmRvbSAqLworPiArICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGluZm8tPmJkX2FkZHIsIG5va2lhX291aSwgMyk7Cis+ICsgICAgICAgICAgICAgICAgICAgICBnZXRfcmFuZG9tX2J5dGVzKGluZm8tPmJkX2FkZHIgKyAzLCAzKTsKKz4gKyAgICAgICAgICAgICB9CisKKworQW5kIHdoeSBkb2VzIGV2ZXJ5IHNpbmdsZSBjaGlwIGZpcm13YXJlIGRvZXMgdGhpcyBkaWZmZXJlbnRseS4gU2VyaW91c2x5LCB0aGlzIGlzIGEgbWVzcy4KKworPiArdm9pZCBoY2lfaDRwX3BhcnNlX2Z3X2V2ZW50KHN0cnVjdCBoY2lfaDRwX2luZm8gKmluZm8sIHN0cnVjdCBza19idWZmICpza2IpCis+ICt7Cis+ICsgICAgIHN3aXRjaCAoaW5mby0+bWFuX2lkKSB7Cis+ICsgICAgIGNhc2UgSDRQX0lEX0NTUjoKKz4gKyAgICAgICAgICAgICBoY2lfaDRwX2JjNF9wYXJzZV9md19ldmVudChpbmZvLCBza2IpOworPiArICAgICAgICAgICAgIG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WxpZCA9IDA7CisJCQkJYnJlYWs7CisJCQl9CisJCX0KKworCQlpZiAobm90X3ZhbGlkKSB7CisJCQlkZXZfaW5mbyhpbmZvLT5kZXYsICJWYWxpZCBibHVldG9vdGggYWRkcmVzcyBub3QgZm91bmQsIHNldHRpbmcgc29tZSByYW5kb21cbiIpOworCQkJLyogV2hlbiBhZGRyZXNzIGlzIG5vdCB2YWxpZCwgdXNlIHNvbWUgcmFuZG9tICovCisJCQltZW1jcHkoaW5mby0+YmRfYWRkciwgbm9raWFfb3VpLCAzKTsKKwkJCWdldF9yYW5kb21fYnl0ZXMoaW5mby0+YmRfYWRkciArIDMsIDMpOworCQl9CisKKwkJc2tiLT5kYXRhW29mZnNldCArIDddID0gaW5mby0+YmRfYWRkclswXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDZdID0gaW5mby0+YmRfYWRkclsxXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDRdID0gaW5mby0+YmRfYWRkclsyXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDBdID0gaW5mby0+YmRfYWRkclszXTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDNdID0gaW5mby0+YmRfYWRkcls0XTsKKwkJc2tiLT5kYXRhW29mZnNldCArIDJdID0gaW5mby0+YmRfYWRkcls1XTsKKwl9CisKKwlmb3IgKGNvdW50ID0gMTsgOyBjb3VudCsrKSB7CisJCUJUX0RCRygiU2VuZGluZyBmaXJtd2FyZSBjb21tYW5kICVkIiwgY291bnQpOworCQlpbml0X2NvbXBsZXRpb24oJmluZm8tPmZ3X2NvbXBsZXRpb24pOworCQlza2JfcXVldWVfdGFpbCgmaW5mby0+dHhxLCBza2IpOworCQlzcGluX2xvY2tfaXJxc2F2ZSgmaW5mby0+bG9jaywgZmxhZ3MpOworCQloY2lfaDRwX291dGIoaW5mbywgVUFSVF9JRVIsIGhjaV9oNHBfaW5iKGluZm8sIFVBUlRfSUVSKSB8CisJCQkJCQkJIFVBUlRfSUVSX1RIUkkpOwor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aygic3RvcCBzY2FuIHN5bmNcbiIpOwotLy8gICAJCWdvdG8gb3V0OwotLy8gIAl9Ci0vLwlwcmludGsoIj09PT09PT1oaD09PT09PT09PT09PT09PT5pcHMgc2NhblxuIik7Ci0gICAgIAl3aGlsZSgxKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogdGhpcyBmdW5jdGlvbiBjYW4gYmUgY2FsbGVkIGluIHR3byBzaXR1YXRpb25zCi0gICAgICAgICAgICAgICAgICogMS0gV2UgaGF2ZSBzd2l0Y2hlZCB0byBhZC1ob2MgbW9kZSBhbmQgd2UgYXJlCi0gICAgICAgICAgICAgICAgICogICAgcGVyZm9ybWluZyBhIGNvbXBsZXRlIHN5bmNybyBzY2FuIGJlZm9yZSBjb25jbHVkZQotICAgICAgICAgICAgICAgICAqICAgIHRoZXJlIGFyZSBubyBpbnRlcmVzdGluZyBjZWxsIGFuZCB0byBjcmVhdGUgYQotICAgICAgICAgICAgICAgICAqICAgIG5ldyBvbmUuIEluIHRoaXMgY2FzZSB0aGUgbGluayBzdGF0ZSBpcwotICAgICAgICAgICAgICAgICAqICAgIElFRUU4MDIxMV9OT0xJTksgdW50aWwgd2UgZm91bmQgYW4gaW50ZXJlc3RpbmcgY2VsbC4KLSAgICAgICAgICAgICAgICAgKiAgICBJZiBzbyB0aGUgaWVlZTgwMjFfbmV3X25ldCwgY2FsbGVkIGJ5IHRoZSBSWCBwYXRoCi0gICAgICAgICAgICAgICAgICogICAgd2lsbCBzZXQgdGhlIHN0YXRlIHRvIElFRUU4MDIxMV9MSU5LRUQsIHNvIHdlIHN0b3AKLSAgICAgICAgICAgICAgICAgKiAgICBzY2FubmluZwotICAgICAgICAgICAgICAgICAqIDItIFdlIGFyZSBsaW5rZWQgYW5kIHRoZSByb290IHVzZXMgcnVuIGl3bGlzdCBzY2FuLgotICAgICAgICAgICAgICAgICAqICAgIFNvIHdlIHN3aXRjaCB0byBJRUVFODAyMTFfTElOS0VEX1NDQU5OSU5HIHRvIH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RlbGF5ZWRfd29yaygmaWVlZS0+R1BJT0NoYW5nZVJGV29ya0l0ZW0pOwogCiAJZGVzdHJveV93b3JrcXVldWUoaWVlZS0+d3EpOwpAQCAtMjYwNywyMiArMjMzNiwxNiBAQAogCXVwKCZpZWVlLT53eF9zZW0pOwogfQogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFN0YXJ0IG9mIFdQQSBjb2RlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogdGhpcyBpcyBzdG9sZW4gZnJvbSB0aGUgaXB3MjIwMCBkcml2ZXIgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQorLyogU3RhcnQgb2YgV1BBIGNvZGUuIFRoaXMgaXMgc3RvbGVuIGZyb20gdGhlIGlwdzIyMDAgZHJpdmVyICAqLwogc3RhdGljIGludCBpZWVlODAyMTFfd3BhX2VuYWJsZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgaW50IHZhbHVlKQogewogCS8qIFRoaXMgaXMgY2FsbGVkIHdoZW4gd3BhX3N1cHBsaWNhbnQgbG9hZHMgYW5kIGNsb3NlcyB0aGUgZHJpdmVyCiAJICogaW50ZXJmYWNlLiAqLwotCXByaW50aygiJXMgV1BBXG4iLHZhbHVlID8gImVuYWJsaW5nIiA6ICJkaXNhYmxpbmciKTsKKwlwcmludGsoIiVzIFdQQVxuIiwgdmFsdWUgPyAiZW5hYmxpbmciIDogImRpc2FibGluZyIpOwogCWllZWUtPndwYV9lbmFibGVkID0gdmFsdWU7CiAJcmV0dXJuIDA7CiB9CiAKLQogc3RhdGljIHZvaWQgaWVlZTgwMjExX3dwYV9hc3NvY19mcmFtZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgY2hhciAqd3BhX2llLAogCQkJICAgICAgIGludC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mZmljOyAvKiB3aGVuIGl0IGlzIHNldCB0byAxLCBVSSBjYW5uJ3Qgc2NhbiBhdCB3aWxsLiAqLworfTsKIAotCXU4CQkJCUlkbGVDb3VudDsgICAgIC8vIChLRUVQX0FMSVZFX0lOVEVSVkFMIC8gQ0hFQ0tfRk9SX0hBTkdfUEVSSU9EKQotCXUzMgkJCQlMYXN0TnVtVHhVbmljYXN0OwotCXUzMgkJCQlMYXN0TnVtUnhVbmljYXN0OworLyogWUosbW9kaWZpZWQsMDgwODI4LGVuZCAqLwogCi0JYm9vbAkJCQliQnVzeVRyYWZmaWM7ICAgIC8vd2hlbiBpdCBpcyBzZXQgdG8gMSwgVUkgY2Fubid0IHNjYW4gYXQgd2lsbC4KLX1saW5rX2RldGVjdF90LCAqcGxpbmtfZGV0ZWN0X3Q7CisvKiBieSBhbXkgZm9yIGxlZAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExFRCBjdXN0b21pemF0aW9uLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworZW51bSBsZWRfc3RyYXRlZ3lfODE4NSB7CisJU1dfTEVEX01PREUwLAorCVNXX0xFRF9NT0RFMSwKKwlIV19MRUQsIC8qIEhXIGNvbnRyb2wgMiBMRURzLCBMRUQwIGFuZCBMRUQxICh0aGVyZSBhcmUgNCBkaWZmZXJlbnQKKwkJICogY29udHJvbCBtb2RlcykuICovCit9OwogCi0vL1lKLG1vZGlmaWVkLDA4MDgyOCxlbmQKK2VudW0gcnRfcmZfcG93ZXJfc3RhdGUgeworCVJGX09OLAorCVJGX1NMRUVQLAorCVJGX09GRgorfTsKIAotLy9ieSBhbXkgZm9yIGxlZAotLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ICBrZWVwQWxpdmVMZXZlbDsgLy9ZSixhZGQsMDgwODI4LGZvciBLZWVwQWxpdmUKLQl1bnNpZ25lZCBsb25nIAlOdW1UeE9rVG90YWw7Ci0JdTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJldHJ5Q250OwotICAgICAgICB1MTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFJldHJ5UmF0ZTsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgICAgICBMYXN0VHhva0NudDsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgTGFzdFJ4b2tDbnQ7Ci0gICAgICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyUmV0cnlDbnQ7Ci0gICAgICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIExhc3RUeE9LQnl0ZXM7Ci0JdW5zaWduZWQgbG9uZyAJCSAgICBOdW1UeE9rQnl0ZXNUb3RhbDsKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgIExhc3RGYWlsVHhSYXRlOwotICAgICAgICBsb25nICAgICAgICAgICAgICAgICAgICAgICAgTGFzdEZhaWxUeFJhdGVTUzsKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgIEZhaWxUeFJhdGVDb3VudDsKLSAgICAgICAgdTMyICAgICAgICAgICAgICAgICAgICAgICAgIExhc3RUeFRocm91Z2hwdXQ7Ci0gICAgICAgIC8vZm9yIHVwIHJhdGUKLSAgICAgICAgdW5zaWduZWQgc2hvcnQgICAgICAgICAgYlRyeXVwaW5nOwotICAgICAgICB1OCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ3VyclR4UmF0ZTsgICAgIC8vdGhlIHJhdGUgYmVmb3JlIHVwCi0gICAgICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyUmV0cnlSYXRlOwotICAgICAgIC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zIFBVUCBwYWNrZXQgICAqLwotI2RlZmluZSBFVEhfUF9JRUVFUFVQQVQJMHgwYTAxCQkvKiBYZXJveCBJRUVFODAyLjMgUFVQCQkqLwotI2RlZmluZSBFVEhfUF9ERUMgICAgICAgMHg2MDAwICAgICAgICAgIC8qIERFQyBBc3NpZ25lZCBwcm90byAgICAgICAgICAgKi8KLSNkZWZpbmUgRVRIX1BfRE5BX0RMICAgIDB4NjAwMSAgICAgICAgICAvKiBERUMgRE5BIER1bXAvTG9hZCAgICAgICAgICAgICovCi0jZGVmaW5lIEVUSF9QX0ROQV9SQyAgICAweDYwMDIgICAgICAgICAgLyogREVDIEROQSBSZW1vdGUgQ29uc29sZSAgICAgICAqLwotI2RlZmluZSBFVEhfUF9ETkFfUlQgICAgMHg2MDAzICAgICAgICAgIC8qIERFQyBETkEgUm91dGluZyAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgRVRIX1BfTEFUICAgICAgIDB4NjAwNCAgICAgICAgICAvKiBERUMgTEFUICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIEVUSF9QX0RJQUcgICAgICAweDYwMDUgICAgICAgICAgLyogREVDIERpYWdub3N0aWNzICAgICAgICAgICAgICAqLwotI2RlZmluZSBFVEhfUF9DVVNUICAgICAgMHg2MDA2ICAgICAgICAgIC8qIERFQyBDdXN0b21lciB1c2UgICAgICAgICAgICAgKi8KLSNkZWZpbmUgRVRIX1BfU0NBICAgICAgIDB4NjAwNyAgICAgICAgICAvKiBERUMgU3lzdGVtcyBDb21tcyBBcmNoICAgICAgICovCi0jZGVmaW5lIEVUSF9QX1JBUlAgICAgICAweDgwMzUJCS8qIFJldmVyc2UgQWRkciBSZXMgcGFja2V0CSovCi0jZGVmaW5lIEVUSF9QX0FUQUxLCTB4ODA5QgkJLyogQXBwbGV0YWxrIEREUAkJKi8KLSNkZWZpbmUgRVRIX1BfQUFSUAkweDgwRjMJCS8qIEFwcGxldGFsayBBQVJQCQkqLwotI2RlZmluZSBFV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ICAgPSBzdGFyX3godSk7ICAgICAgICBcCi0gICAgdyAgID0gc3Rhcl94KHYpOyAgICAgICAgXAotICAgIHQgICA9IHcgXiAoeCk7ICAgICAgICAgIFwKLSAgICh5KSAgPSB1IF4gdiBeIHc7ICAgICAgICBcCi0gICAoeSkgXj0gcm90cih1IF4gdCwgIDgpIF4gXAotCSAgcm90cih2IF4gdCwgMTYpIF4gXAotCSAgcm90cih0LDI0KQotCi0vKiBpbml0aWFsaXNlIHRoZSBrZXkgc2NoZWR1bGUgZnJvbSB0aGUgdXNlciBzdXBwbGllZCBrZXkgKi8KLQotI2RlZmluZSBsb29wNChpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLXsgICB0ID0gcm90cih0LCAgOCk7IHQgPSBsc19ib3godCkgXiByY29fdGFiW2ldOyAgICBcCi0gICAgdCBePSBFX0tFWVs0ICogaV07ICAgICBFX0tFWVs0ICogaSArIDRdID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNCAqIGkgKyAxXTsgRV9LRVlbNCAqIGkgKyA1XSA9IHQ7ICAgIFwKLSAgICB0IF49IEVfS0VZWzQgKiBpICsgMl07IEVfS0VZWzQgKiBpICsgNl0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs0ICogaSArIDNdOyBFX0tFWVs0ICogaSArIDddID0gdDsgICAgXAotfQotCi0jZGVmaW5lIGxvb3A2KGkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAoteyAgIHQgPSByb3RyKHQsICA4KTsgdCA9IGxzX2JveCh0KSBeIHJjb190YWJbaV07ICAgIFwKLSAgICB0IF49IEVfS0VZWzYgKiBpXTsgICAgIEVfS0VZWzYgKiBpICsgNl0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs2ICogaSArIDFdOyBFX0tFWVs2ICogaSArIDddID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNiAqIGkgKyAyXTsgRV9LRVlbNiAqIGkgKyA4XSA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B7CiAJcEJBLT5iVmFsaWQgPSB0cnVlOwogCWlmKFRpbWUgIT0gMCkKQEAgLTI1LDcgKzI1LDcgQEAKICAqICAgaW5wdXQ6ICBQQkFfUkVDT1JECQkJcEJBICAvL0JBIGVudHJ5IHRvIGJlIGRpc2FibGVkCiAgKiAgb3V0cHV0OiAgbm9uZQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIERlQWN0aXZhdGVCQUVudHJ5KCBzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgUEJBX1JFQ09SRCBwQkEpCitzdGF0aWMgdm9pZCBEZUFjdGl2YXRlQkFFbnRyeShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgUEJBX1JFQ09SRCBwQkEpCiB7CiAJcEJBLT5iVmFsaWQgPSBmYWxzZTsKIAlkZWxfdGltZXJfc3luYygmcEJBLT5UaW1lcik7CkBAIC0zNyw3ICszNyw3IEBACiAgKiAgb3V0cHV0OiAgbm9uZQogICogIG5vdGljZTogIEFzIFBUWF9UU19SRUNPUkQgc3RydWN0dXJlIHdpbGwgYmUgZGVmaW5lZCBpbiBRT1MsIHNvIHdhaXQgdG8gYmUgbWVyZ2VkLiAvL0ZJWE1FCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXU4IFR4VHNEZWxldGVCQSggc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBUWF9UU19SRUNPUkQJcFR4VHMpCitzdGF0aWMgdTggVHhUc0RlbGV0ZUJBKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBQVFhfVFNfUkVDT1JE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ZSBhbmQgQVAgc3VwcG9ydHMgNDAgYncKICovCi1ib29sIElzSFRIYWxmTm1vZGU0MEJhbmR3aWR0aChzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSkKK3N0YXRpYyBib29sIElzSFRIYWxmTm1vZGU0MEJhbmR3aWR0aChzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSkKIHsKIAlib29sCQkJcmV0VmFsdWUgPSBmYWxzZTsKIAlQUlRfSElHSF9USFJPVUdIUFVUCSBwSFRJbmZvID0gaWVlZS0+cEhUSW5mbzsKQEAgLTIzOCw3ICsyMzgsNyBAQAogCXJldHVybiByZXRWYWx1ZTsKIH0KIAotYm9vbCBJc0hUSGFsZk5tb2RlU0dJKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBib29sIGlzNDBNSHopCitzdGF0aWMgYm9vbCBJc0hUSGFsZk5tb2RlU0dJKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBib29sIGlzNDBNSHopCiB7CiAJYm9vbAkJCXJldFZhbHVlID0gZmFsc2U7CiAJUFJUX0hJR0hfVEhST1VHSFBVVAkgcEhUSW5mbyA9IGllZWUtPnBIVEluZm87CkBAIC0zNzYsNyArMzc2LDcgQEAKICAqICByZXR1cm46CiAgKiAgbm90aWNlOgogICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIEhUSU9UUGVlckRldGVybWluZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSkKK3N0YXRpYyB2b2lkIEhUSU9UUGVlckRldGVybWluZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSkKIHsKIAlQUlRfSElHSF9USFJPVUdIUFVUCXBIVEluZm8gPSBpZWVlLT5wSFRJbmZvOwogCXN0cnVjdCBpZWVlODAyMTFfbmV0d29yayAqbmV0ID0gJmllZWUtPmN1cnJlbnRfbmV0d29yazsKQEAgLTQxMyw3ICs0MTMsNyBAQAogICogIG91dHB1dDogIG5vbmUKICAqICByZXR1cm46ICByZXR1cm4gMSBpZiBkcml2ZXIgc2hvdWxkIGRlY2xhcmUgTUNTMTMgb25seShvdGhlcndpc2UgcmV0dXJuIDApCiAgICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi11OCBIVElPVEFjdElzRGlzYWJsZU1DUzE0KHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCB1OCAqUGVlck1hY0FkZHIpCitzdGF0aWMgdTggSFRJT1RBY3RJc0Rpc2FibGVNQ1MxNChzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgdTggKlBlZXJNYWNBZGRyKQogewogCXU4IHJldCA9IDA7CiAJcmV0dXJuIHJldDsKQEAgLTQzMiw3ICs0MzIsNyBAQAogKiBSZXR1cm46CXRydWUgaWYgZHJpdmVyIHNob3VsZCBkaXNhYmxlIE1DUzE1CiAqIDIwMDguMDQuMTUJRW1pbHkKICovCi1ib29sIEhUSU9UQWN0SXNEaXNhYmxlTUNTMTUoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUpCitzdGF0aWMgYm9vbCBIVElPVEFjdElzRGlzYWJsZU1DUzE1KHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlKQogewogCWJvb2wgcmV0VmFsdWUgPSBmYWxzZTsKIApAQCAtNDY5LDcgKzQ2OSw4IEBACiAqIFJldHVybjoJdHJ1ZSBpZiBkcml2ZXIgc2hvdWxkIGRpc2FibGUgYWxsIHR3byBzcGF0aWFsIHN0cmVhbSBwYWNrZXQKICogMjAwOC4wNC4yMQlFbWlseQogKi8KLWJvb2wgSFRJ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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi11OCBIVElPVEFjdElzTWdudFVzZUNDSzZNKHN0cnVjdCBpZWVlODAyMTFfbmV0d29yayAqbmV0d29yaykKK3N0YXRpYyB1OCBIVElPVEFjdElzTWdudFVzZUNDSzZNKHN0cnVjdCBpZWVlODAyMTFfbmV0d29yayAqbmV0d29yaykKIHsKIAl1OAlyZXRWYWx1ZSA9IDA7CiAKQEAgLTUxNSw3ICs1MTcsNyBAQAogCXJldHVybiByZXRWYWx1ZTsKIH0KIAotdTggSFRJT1RBY3RJc0NDREZzeW5jKHU4ICpQZWVyTWFjQWRkcikKK3N0YXRpYyB1OCBIVElPVEFjdElzQ0NERnN5bmModTggKlBlZXJNYWNBZGRyKQogewogCXU4CXJldFZhbHVlID0gMDsKIAlpZigJKG1lbWNtcChQZWVyTWFjQWRkciwgVU5LTk9XTl9CT1JBRENPTSwgMyk9PTApIHx8CkBAIC03OTIsNyArNzk0LDcgQEAKICAqICByZXR1cm46ICBhbHdheXMgd2UgcmV0dXJuIHRydWUKICAqICBub3RpY2U6CiAgICogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi11OCBIVF9QaWNrTUNTUmF0ZShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgdTggKnBPcGVyYXRlTUNTKQorc3RhdGljIHU4IEhUX1BpY2tNQ1NSYXRlKHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCB1OCAqcE9wZXJhdGVNQ1MpCiB7CiAJdTgJCQkJCWk7CiAJaWYgKHBPcGVyYXRlTUNTID09IE5VTEwpCkBAIC05MDcsNyArOTA5LDggQEAKICoqC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W5zaWduZWQgbG9uZyBkYXRhKQogewogCS8vIE5vdCBpbXBsZW1lbnQgeWV0CiAJLy8gVGhpcyBpcyB1c2VkIGZvciBXTU1TQSBhbmQgQUNNLgpAQCAtMjIsNyArMjIsNyBAQAogICogIHJldHVybjogIE5VTEwKICAqICBub3RpY2U6CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgUnhQa3RQZW5kaW5nVGltZW91dCh1bnNpZ25lZCBsb25nIGRhdGEpCitzdGF0aWMgdm9pZCBSeFBrdFBlbmRpbmdUaW1lb3V0KHVuc2lnbmVkIGxvbmcgZGF0YSkKIHsKIAlQUlhfVFNfUkVDT1JECXBSeFRzID0gKFBSWF9UU19SRUNPUkQpZGF0YTsKIAlzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSA9IGNvbnRhaW5lcl9vZihwUnhUcywgc3RydWN0IGllZWU4MDIxMV9kZXZpY2UsIFJ4VHNSZWNvcmRbcFJ4VHMtPm51bV0pOwpAQCAtOTksNyArOTksNyBAQAogICogIHJldHVybjogIE5VTEwKICAqICBub3RpY2U6CiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgVHNBZGRCYVByb2Nlc3ModW5zaWduZWQgbG9uZyBkYXRhKQorc3RhdGljIHZvaWQgVHNBZGRCYVByb2Nlc3ModW5zaWduZWQgbG9uZyBkYXRhKQogewogCVBUWF9UU19SRUNPUkQJcFR4VHMgPSAoUFRYX1RTX1JFQ09SRClkYXRhOwogCXU4IG51bSA9IHBUeFRzLT5udW07CkBAIC0xMTAsNyArMTEwLDcgQEAKIH0KIAogCi12b2lkIFJlc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GV2LCBpKSk7CiB9CiAKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLUhXIFNUVUZGLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi12b2lkIHJ0bDgxOTJfc2V0X21vZGUoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgaW50IG1vZGUpCi17Ci0JdTggZWNtZDsKLQlyZWFkX25pY19ieXRlKGRldiwgRVBST01fQ01ELCAmZWNtZCk7Ci0JZWNtZCA9IGVjbWQgJiB+RVBST01fQ01EX09QRVJBVElOR19NT0RFX01BU0s7Ci0JZWNtZCA9IGVjbWQgfCAobW9kZTw8RVBST01fQ01EX09QRVJBVElOR19NT0RFX1NISUZUKTsKLQllY21kID0gZWNtZCAmIH5FUFJPTV9DU19CSVQ7Ci0JZWNtZCA9IGVjbWQgJiB+RVBST01fQ0tfQklUOwotCXdyaXRlX25pY19ieXRlKGRldiwgRVBST01fQ01ELCBlY21kKTsKLX0KLQotCiB2b2lkIHJ0bDgxOTJfdXBkYXRlX21zcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewogCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gaWVlZTgwMjExX3ByaXYoZGV2KTsKQEAgLTkwMywxMiArODc5LDYgQEAKIAlyZXR1cm47CiB9CiAKLQotaW50IGFsbG9jX3R4X2JlYWNvbl9kZXNjX3Jpbmcoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgaW50IGNvdW50KQotewotCXJldHVybiAwOwotfQotCiBpbmxpbmUgdTE2IGllZWVyYXRlMnJ0bHJhdGUoaW50IHJhdGUpCiB7CiAJc3dpdGNo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zZSBtYWtlCiAgKiAgICAgICAgICAgIHN1cmUgaXQgaGFzIGJlZW4gc3luY2VkIHdpdGggdGhlIG5ld2VzdC4KICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHJ0bDgxOTJfQkJfQ29uZmlnX1BhcmFGaWxlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCitzdGF0aWMgdm9pZCBydGw4MTkyX0JCX0NvbmZpZ19QYXJhRmlsZShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewogCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gaWVlZTgwMjExX3ByaXYoZGV2KTsKIAl1OCByZWdfdTggPSAwLCBlQ2hlY2tJdGVtID0gMCwgc3RhdHVzID0gMDsKQEAgLTEwNzAsNyArMTA3MSw3IEBACiAgKiByZXR1cm46ICAgIG5vbmUKICAqIG5vdGljZToKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHJ0bDgxOTJfU2V0VHhQb3dlckxldmVsKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHU4IGNoYW5uZWwpCitzdGF0aWMgdm9pZCBydGw4MTkyX1NldFR4UG93ZXJMZXZlbChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCB1OCBjaGFubmVsKQogewogCXN0cnVjdCByODE5Ml9wcml2ICpwcml2ID0gaWVlZTgwMjExX3ByaXYoZGV2KTsKIAl1OAlwb3dlcmxldmVsID0gcHJpdi0+VHhQb3dlckxldmVsQ0NLW2NoYW5uZWwtMV07CkBAIC0xMjM5LDkgKzEyNDAsOSBAQAogICogcmV0dXJuOiAgICB0cnVlIGlmIGZpbmlzaGVkLCBmYWxzZSBvdGhlcndpc2UKICAqIG5vdGljZToKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioq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c3RlciAqLwotI2RlZmluZSBTQjEwNVhBX01EUl9OUFMJCTB4MDggIC8qIDl0aCBCaXQgUG9sYXJpdHkgU2VsZWN0ICovCi0jZGVmaW5lIFNCMTA1WEFfTURSX0FNRQkJMHgwMiAgLyogQXV0byBNdWx0aS1kcm9wIEVuYWJsZSAqLwotI2RlZmluZSBTQjEwNVhBX01EUl9NREUJCTB4MDEgIC8qIE11bHRpIERyb3AgRW5hYmxlICovCi0KLSNkZWZpbmUgU0IxMDVYX1NQUgkJNwkvKiBJL086IFNjcmF0Y2ggUmVnaXN0ZXIgKi8KLQotLyoKLSAqIERMQUI9MQotICovCi0jZGVmaW5lIFNCMTA1WF9ETEwJCTAJLyogT3V0OiBEaXZpc29yIExhdGNoIExvdyAqLwotI2RlZmluZSBTQjEwNVhfRExNCQkxCS8qIE91dDogRGl2aXNvciBMYXRjaCBIaWdoICovCi0KLS8qCi0gKiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgKiBETEFCKExDUls3XSkgPSAwICwgTUNSWzZdID0gMSAgPT09PT09PT09PT09PSAgUGFnZSAyIFJlZ2lzdGVycyAqCi0gKiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKi8KLSNkZWZpbmUgU0IxMDVYX0dJQ1IJCTEJLyogR2xvYmFsIEludGVycnVwdCBDb250cm9sIFJlZ2lzdGVyICovCi0jZGVmaW5lIFNCMTA1WF9HSUNSX0dJTSAgIAkweDAxICAvKiBHbG9iYWwgSW50ZXJydXB0IE1hc2sgKi8KLQotI2RlZmluZSBTQjEwNVhfR0lTUgkJMgkvKiBHbG9iYWwgSW50ZXJydXB0IFN0YXR1cyBSZWdpc3RlciAqLwotI2RlZmluZSBTQjEwNVhfR0lTUl9NR0lDUjAgIAkweDgwICAvKiBNaXJyb3IgdGhlIGNvbnRlbnQgb2Yg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cihwb3J0LFBBR0VfNCxTQjEwNVhfUlRSLHJ0cltwb3J0LT5saW5lXSk7IAotCWFmcl9zdGF0dXMgPSBzYjEwNTRfZ2V0X3JlZ2lzdGVyKHBvcnQsIFBBR0VfNCwgU0IxMDVYX0FGUik7Ci0JCQotCXJldHVybiBhZnJfc3RhdHVzOwotfQotCi1zdGF0aWMgaW50IGdldF9kZXZpY2VfdHlwZShpbnQgYXJnKQotewotCWludCByZXQ7Ci0gICAgICAgIHJldCA9IGluYihtcF9kZXZzW2FyZ10ub3B0aW9uX3JlZ19hZGRyK01QX09QVFJfRElSMCk7Ci0gICAgICAgIHJldCA9IChyZXQgJiAweGYwKSA+PiA0OwotICAgICAgICBzd2l0Y2ggKHJldCkKLSAgICAgICAgewotICAgICAgICAgICAgICAgY2FzZSBESVJfVUFSVF8xNkM1NTA6Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQT1JUXzE2QzU1WDsKLSAgICAgICAgICAgICAgIGNhc2UgRElSX1VBUlRfMTZDMTA1MDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfMTZDMTA1WDsKLSAgICAgICAgICAgICAgIGNhc2UgRElSX1VBUlRfMTZDMTA1MEE6Ci0gICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgaWYgKG10cHQtPnBvcnQubGluZSA8IDIpCi0gICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQT1JUXzE2QzEwNVhBOwotICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgIGlmIChtdHB0LT5kZXZpY2UtPmRldmljZV9pZCAmIDB4NTApCi0gICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUE9SVF8xNkM1NVg7Ci0gICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICA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otCQl7Ci0JCQlmY3JfYXJyW2ldID0gMHgwMTsKLQkJCQotCQl9Ci0JfQotCWlmKGRlZXBfY291bnQ9PTApCi0JewotCQlmb3IoaT0wO2k8MjU2O2krKykKLQkJewotCQkJZGVlcFtpXSA9IDE7Ci0JCQkKLQkJfQotCX0KLQlpZihydHJfY291bnQ9PTApCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IoaT0wO2k8MjU2O2krKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBydHJbaV0gPSAweDEwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgfQotCWlmKHR0cl9jb3VudD09MCkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGZvcihpPTA7aTwyNTY7aSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHR0cltpXSA9IDB4Mzg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLQotcHJpbnRrKCJNVUxUSSBJTklUXG4iKTsKLQlmb3IoIGk9MDsgaTwgbXBfbnJwY2licmRzOyBpKyspCi0JewotCi0JCXdoaWxlKCAoZGV2ID0gcGNpX2dldF9kZXZpY2UobXBfcGNpYm9hcmRzW2ldLnZlbmRvcl9pZCwgbXBfcGNpYm9hcmRzW2ldLmRldmljZV9pZCwgZGV2KSApICkKLQotCQl7Ci1wcmludGsoIkZPVU5Efn5+XG4iKTsKLS8vCUNlbnQgT1MgYnVnIGZpeAotLy8JCQlpZiAobXBfcGNpYm9hcmRzW2ldLmRldmljZV9pZCAmIDB4MDgwMCkKLQkJCXsKLQkJCQlpbnQgc3RhdHVzOwotCSAgICAgICAgCQlwY2lfZGlzYWJsZV9kZXZpY2UoZGV2KTsKLQkgICAgICAgIAkJc3RhdHVzID0gcGNpX2VuYWJsZV9kZXZpY2UoZGV2KTsKLSAgICAgICAgICAgIAotCSAgIAkJICAgICAJaWYgKHN0YXR1cyAhPSAwKQotICAgICAgICA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0OyAgICAgICAvKiBwb3J0cyBvbiB0aGlzIElSUSAqLwotICAgICAgICB1bnNpZ25lZCBpbnQgICAgICAgIGNhcGFiaWxpdGllczsgICAvKiBwb3J0IGNhcGFiaWxpdGllcyAqLwotICAgICAgICB1bnNpZ25lZCBzaG9ydCAgICAgIHJldjsKLSAgICAgICAgdW5zaWduZWQgY2hhciAgICAgICBhY3I7Ci0gICAgICAgIHVuc2lnbmVkIGNoYXIgICAgICAgaWVyOwotICAgICAgICB1bnNpZ25lZCBjaGFyICAgICAgIGxjcjsKLSAgICAgICAgdW5zaWduZWQgY2hhciAgICAgICBtY3I7Ci0gICAgICAgIHVuc2lnbmVkIGNoYXIgICAgICAgbWNyX21hc2s7ICAgLyogbWFzayBvZiB1c2VyIGJpdHMgKi8KLSAgICAgICAgdW5zaWduZWQgY2hhciAgICAgICBtY3JfZm9yY2U7ICAvKiBtYXNrIG9mIGZvcmNlZCBiaXRzICovCi0gICAgICAgIHVuc2lnbmVkIGNoYXIgICAgICAgbHNyX2JyZWFrX2ZsYWc7Ci0KLSAgICAgICAgdm9pZCAgICAgICAgICAgICgqcG0pKHN0cnVjdCBzYl91YXJ0X3BvcnQgKnBvcnQsCi0gICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgc3RhdGUsIHVuc2lnbmVkIGludCBvbGQpOwotICAgICAgICBzdHJ1Y3QgbXBfZGV2aWNlX3QgKmRldmljZTsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgIGludGVyZmFjZV9jb25maWdfYWRkcjsKLSAgICAgICAgdW5zaWduZWQgbG9uZyAgIG9wdGlvbl9iYXNlX2FkZHI7Ci0gICAgICAgIHVuc2lnbmVkIGNoYXIgICBpbnRlcmZhY2U7Ci0gICAgICAgIHVuc2lnbmVkIGNoYXIgICBwb2xsX3R5cGU7Ci19OwotCi1zdHJ1Y3QgaXJxX2luZm8gewotICAgICAgICBzcGlubG9ja190ICAgICAgbG9jazsKLSAgICAgICAgc3RydWN0IG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9IDM4NDAwOwotICAgICAgICB1cGZfdCBmbGFncyA9IHBvcnQtPmZsYWdzICYgVVBGX1NQRF9NQVNLOwotCi0gICAgICAgIGlmIChmbGFncyA9PSBVUEZfU1BEX0hJKQotICAgICAgICAgICAgICAgIGFsdGJhdWQgPSA1NzYwMDsKLSAgICAgICAgaWYgKGZsYWdzID09IFVQRl9TUERfVkhJKQotICAgICAgICAgICAgICAgIGFsdGJhdWQgPSAxMTUyMDA7Ci0gICAgICAgIGlmIChmbGFncyA9PSBVUEZfU1BEX1NISSkKLSAgICAgICAgICAgICAgICBhbHRiYXVkID0gMjMwNDAwOwotICAgICAgICBpZiAoZmxhZ3MgPT0gVVBGX1NQRF9XQVJQKQotICAgICAgICAgICAgICAgIGFsdGJhdWQgPSA0NjA4MDA7Ci0KLSAgICAgICAgZm9yICh0cnkgPSAwOyB0cnkgPCAyOyB0cnkrKykgewotCi0gICAgICAgICAgICAgICAgc3dpdGNoICh0ZXJtaW9zLT5jX2NmbGFnICYgKENCQVVEIHwgQ0JBVURFWCkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIAljYXNlIEI5MjE2MDAgICAgOiBiYXVkID0gOTIxNjAwOyAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNDYwODAwICAgIDogYmF1ZCA9IDQ2MDgwMDsgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjIzMDQwMCAgICA6IGJhdWQgPSAyMzA0MDA7ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxMTUyMDAgICAgOiBiYXVkID0gMTE1MjAwOyAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNTc2MDAgICAgIDogYmF1ZCA9IDU3NjAwOyAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjM4NDAwICAgICA6IGJhdWQgPSAzODQwMDsgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxOTIwMCAgICAgOiBiYXVkID0gMTkyMDA7ICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCOTYwMCAgICAgIDogYmF1ZCA9IDk2MDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjQ4MDAgICAgICA6IGJhdWQgPSA0ODAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIyNDAwICAgICAgOiBiYXVkID0gMjQwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTgwMCAgICAgIDogYmF1ZCA9IDE4MDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjEyMDAgICAgICA6IGJhdWQgPSAxMjAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI2MDAgICAgICAgOiBiYXVkID0gNjAwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMzAwICAgICAgIDogYmF1ZCA9IDMwMDsgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEIyMDAgICAgICAgOiBiYXVkID0gMjAwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTUwICAgICAgIDogYmF1ZCA9IDE1MDsgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjEzNCAgICAgICA6IGJhdWQgPSAxMzQ7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxMTAgICAgICAgOiBiYXVkID0gMTEwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNzUgICAgICAgIDogYmF1ZCA9IDc1OyAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjUwICAgICAgICA6IGJhdWQgPSA1MDsgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAlkZWZhdWx0ICAgICAgICAgOiBiYXVkID0gOTYwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoYmF1ZCA9PSAzODQwMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGJhdWQgPSBhbHRiYXVkOwotCi0gICAgICAgICAgICAgICAgaWYgKGJhdWQgPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGJhdWQgPSA5NjAwOwotCi0gICAgICAgICAgICAgICAgaWYgKGJhdWQgPj0gbWluICYmIGJhdWQgPD0gbWF4KQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhdWQ7Ci0KLSAgICAgICAgICAgICAgICB0ZXJtaW9zLT5jX2NmbGFnICY9IH5DQkFVRDsKLSAgICAgICAgICAgICAgICBpZiAob2xkKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZXJtaW9zLT5jX2NmbGFnIHw9IG9sZC0+Y19jZmxhZyAmIENCQVVEOwotICAgICAgICAgICAgICAgICAgICAgICAgb2xkID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRlcm1pb3MtPmNfY2ZsYWcgfD0gQjk2MDA7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gMDsKLX0KLXVuc2lnbmVkIGludCBzYl91YXJ0X2dldF9kaXZpc29yKHN0cnVjdCBzYl91YXJ0X3BvcnQgKnBvcnQsIHVuc2lnbmVkIGludCBiYXVkKQotewotICAgICAgICB1bnNpZ25lZCBpbnQgcXVvdDsKLQotICAgICAgICBpZiAoYmF1ZCA9PSAzODQwMCAmJiAocG9ydC0+ZmxhZ3MgJiBVUEZfU1BEX01BU0spID09IFVQRl9TUERfQ1VTVCkKLSAgICAgICAgICAgICAgICBxdW90ID0gcG9ydC0+Y3VzdG9tX2Rpdmlzb3I7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBxdW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ZHVjdF9uYW1lID0gIlNMSUMgVGVjaG5vbG9neSh0bSkgU2VydmVyICIKIAkJImFuZCBTdG9yYWdlIEFjY2VsZXJhdG9yIChOb24tQWNjZWxlcmF0ZWQpIjsKIHN0YXRpYyBjaGFyICpzbGljX3ZlbmRvciA9ICJBbGFjcml0ZWNoLCBJbmMuIjsKIApAQCAtMTQ0LDI5ICsxNDQsNiBAQAogCiBNT0RVTEVfREVWSUNFX1RBQkxFKHBjaSwgc2xpY19wY2lfdGJsKTsKIAotI2RlZmluZSBTTElDX0dFVF9TTElDX0hBTkRMRShfYWRhcHRlciwgX3BzbGljX2hhbmRsZSkgICAgICAgICAgICAgICAgICAgXAoteyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fbG9ja19pcnFzYXZlKCZfYWRhcHRlci0+aGFuZGxlX2xvY2subG9jaywgICAgICAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi0JX3BzbGljX2hhbmRsZSAgPSAgX2FkYXB0ZXItPnBmcmVlX3NsaWNfaGFuZGxlczsgICAgICAgICAgICAgICAgIFwKLQlpZiAoX3BzbGljX2hhbmRsZSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQlfYWRhcHRlci0+cGZyZWVfc2xpY19oYW5kbGVzID0gX3BzbGljX2hhbmRsZS0+bmV4dDsgICAgIFwKLQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJl9hZGFwdGVyLT5oYW5kbGVfbG9jay5sb2NrLCAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcC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5KHMsICJBUFBPU18xNiIsIG4pOworCQlicmVhazsKKwlkZWZhdWx0OgorCQlzdWJzeXNfdW5rbm93bl90b19zKHN1YnN5cywgcywgbik7CisJCWJyZWFrOworCX0KKwlzW24gLSAxXSA9ICdcMCc7CisJcmV0dXJuIHM7Cit9CisKKy8qIENPTlNPTEUgKi8KKworI2RlZmluZSBTVUJTWVNfQ09OU09MRV9WSURFTyAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxKQkvKiAxNyAqLworI2RlZmluZSBTVUJTWVNfQ09OU09MRV9LQkRNT1UgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyKQkvKiAxOCAqLworI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wNCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wNSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA1KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wNiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA2KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wNyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA3KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wOCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA4KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8wOSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA5KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xMCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxMCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTEgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTEpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzEyICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDEyKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xMyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxMykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTQgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTQpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzE1ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDE1KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xNiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxNikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTcgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTcpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzE4ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDE4KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xOSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxOSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjAgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjApCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzIxICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDIxKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yMiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyMikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjMgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjMpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI0ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI0KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yNSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyNSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjYgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjYpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI3ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI3KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yOCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyOCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjkgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjkpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzMwICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDMwKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zMSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzMSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzIgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzIpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzMzICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDMzKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zNCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzNCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzUgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzUpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM2ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM2KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zNyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzNykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzggICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzgpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM5ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM5KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80MCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0MCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDEgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDEpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQyICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQyKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80MyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0MykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDQgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDQpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQ1ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQ1KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80NiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0NikKKworc3RhdGljIGlubGluZSBjaGFyICoKK3N1YnN5c19jb25zb2xlX3RvX3MoaW50IHN1YnN5cywgY2hhciAqcywgaW50IG4pCit7CisJc3dpdGNoIChzdWJzeXMpIHsKKwljYXNlIFNVQlNZU19DT05TT0xFX1ZJREVPOgorCQlzdHJuY3B5KHMsICJDT05TT0xFX1ZJREVPIiwgbik7CisJCWJyZWFrOworCWNhc2UgU1VCU1lTX0NPTlNPTEVfS0JETU9VOgorCQlzdHJuY3B5KHMsICJDT05TT0xFX0tCRE1PVSIsIG4pOworCQlicmVhazsKKwljYXNlIFNVQlNZU19DT05TT0xFXzA0OgorCQlzdHJuY3B5KHMsICJDT05TT0xFXzA0Iiwgbik7CisJCWJyZWFrOworCWNhc2UgU1VCU1lTX0NPTlNPTEVfMDU6CisJCXN0cm5jcHkocywgIkNPTlNPTEVfMDUiLCBuKTsKKwkJYnJlYWs7CisJY2FzZSBTVUJTWVNfQ09OU09MRV8wNjoKKwkJc3RybmNweShzLCAiQ09OU09MRV8wNiIsIG4pOworCQlicmVhazsKKwljYXNlIFNVQlNZU19DT05TT0xFXzA3OgorCQlzdHJuY3B5KHMsICJDT05TT0xFXzA3I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4IGNkYXRhM1s1XTsKKwlVOCBjZGF0YTRbM107CisJaW50IGRhc2hjb3VudCA9IDA7CisJaW50IGJyYWNlID0gMDsKKwl1bnNpZ25lZCBsb25nIHVsZGF0YTsKKworCWlmICghcCkKKwkJcmV0dXJuIGd1aWQ7CisJaWYgKCpwID09ICd7JykgeworCQlwKys7CisJCWJyYWNlID0gMTsKKwl9CisJd2hpbGUgKGNvdW50IDwgMzIpIHsKKwkJaWYgKCpwID09ICd9JykKKwkJCXJldHVybiBndWlkOworCQlpZiAoKnAgPT0gJ1wwJykKKwkJCXJldHVybiBndWlkOworCQljID0gdG91cHBlcigqcCk7CisJCXArKzsKKwkJaWYgKGMgPT0gJy0nKSB7CisJCQlzd2l0Y2ggKGRhc2hjb3VudCkgeworCQkJY2FzZSAwOgorCQkJCWlmIChpICE9IDgpCisJCQkJCXJldHVybiBndWlkOworCQkJCWJyZWFrOworCQkJY2FzZSAxOgorCQkJCWlmIChpICE9IDQpCisJCQkJCXJldHVybiBndWlkOworCQkJCWJyZWFrOworCQkJY2FzZSAyOgorCQkJCWlmIChpICE9IDQpCisJCQkJCXJldHVybiBndWlkOworCQkJCWJyZWFrOworCQkJY2FzZSAzOgorCQkJCWlmIChpICE9IDQpCisJCQkJCXJldHVybiBndWlkOworCQkJCWJyZWFrOworCQkJZGVmYXVsdDoKKwkJCQlyZXR1cm4gZ3VpZDsKKwkJCX0KKwkJCWRhc2hjb3VudCsrOworCQkJaSA9IDA7CisJCQljb250aW51ZTsKKwkJfQorCQlpZiAoKGMgPj0gJzAnICYmIGMgPD0gJzknKSB8fCAoYyA+PSAnQScgJiYgYyA8PSAnRicpKQorCQkJaSsrOworCQllbHNlCisJCQlyZXR1cm4gZ3VpZDsKKwkJeFtjb3VudCsrXSA9IGM7CisJfQorCXhbY291bnRdID0gJ1wwJzsKKwlpZiAoYnJhY2UpIHsKKwkJaWYgKCpwID09ICd9JykKKwkJCXArKzsKKwkJZWxzZQorCQkJcmV0dXJuIGd1aWQ7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1NWQUxJRChkZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCSgoZGQgIT0gTlVMTCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmCVwKKwkJICgoZGQpLT5zaWcxID09IHNpemVvZihQUklWQVRFREVWSUNFREFUQSkpICYmCVwKKwkJICgoZGQpLT5zaWcyID09IGRkKSkKKworLyoqIFZlcmlmaWVzIHRoZSBjb25zaXN0ZW5jeSBvZiB5b3VyIFBSSVZBVEVGSUxFREFUQSBzdHJ1Y3R1cmUgdXNpbmcKKyAqICBjb252ZW50aW9uYWwgInNpZ25hdHVyZSIgZmllbGRzOgorICogIDxwPgorICogIC0gc2lnMSBzaG91bGQgY29udGFpbiB0aGUgc2l6ZSBvZiB0aGUgc3RydWN0dXJlCisgKiAgLSBzaWcyIHNob3VsZCBjb250YWluIGEgcG9pbnRlciB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBzdHJ1Y3R1cmUKKyAqLworI2RlZmluZSBGRExPT0tTVkFMSUQoZmQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkoKGZkICE9IE5VTEwpICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgICAgIFwKKwkgKChmZCktPnNpZzEgPT0gc2l6ZW9mKFBSSVZBVEVGSUxFREFUQSkpICYmICAgIFwKKwkgKChmZCktPnNpZzIgPT0gZmQpKQorCisvKiogTG9ja3MgZGQtPmxvY2tEZXYgaWYgeW91IGhhdm4ndCBhbHJlYWR5IGxvY2tlZCBpdCAqLworI2RlZmluZSBMT0NLREVWKGRkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAoIWxvY2tlZERldikgewkJCQkgICAgICAgXAorCQkJc3Bpbl9sb2NrKCZkZC0+bG9ja0Rldik7CQkgICAgICAgXAorCQkJbG9ja2VkRGV2ID0gVFJVRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBVbmxvY2tzIGRkLT5sb2NrRGV2IGlmIHlvdSBwcmV2aW91c2x5IGxvY2tlZCBpdCAqLworI2RlZmluZSBVTkxPQ0tERVYoZGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAobG9ja2VkRGV2KSB7CQkJCSAgICAgICBcCisJCQlzcGluX3VubG9jaygmZGQtPmxvY2tEZXYpOwkJICAgICAgIFwKKwkJCWxvY2tlZERldiA9IEZBTFNFOwkJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIExvY2tzIGRkLT5sb2NrRGV2SVNSIGlmIHlvdSBoYXZuJ3QgYWxyZWFkeSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgTE9DS0RFVklTUihkZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKCFsb2NrZWREZXZJU1IpIHsJCQkJICAgICAgIFwKKwkJCXNwaW5fbG9ja19pcnFzYXZlKCZkZC0+bG9ja0RldklTUiwgZmxhZ3MpOyAgICAgXAorCQkJbG9ja2VkRGV2SVNSID0gVFJVRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBVbmxvY2tzIGRkLT5sb2NrRGV2SVNSIGlmIHlvdSBwcmV2aW91c2x5IGxvY2tlZCBpdCAqLworI2RlZmluZSBVTkxPQ0tERVZJU1IoZGQpCQkJCQkJXAorCXsJCQkJCQkJCVwKKwkJaWYgKGxvY2tlZERldklTUikgewkJCQkJXAorCQkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmZGQtPmxvY2tEZXZJU1IsIGZsYWdzKTsgXAorCQkJbG9ja2VkRGV2SVNSID0gRkFMU0U7CQkJCVwKKwkJfQkJCQkJCQlcCisJfQorCisvKiogTG9ja3MgTG9ja0dsb2JhbElTUiBpZiB5b3UgaGF2bid0IGFscmVhZHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIExPQ0tHTE9CQUxJU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWlmICghbG9ja2VkR2xvYmFsSVNSKSB7CQkJCSAgICAgICBcCisJCQlzcGluX2xvY2tfaXJxc2F2ZSgmTG9ja0dsb2JhbElTUiwgZmxhZ3MpOyAgICAgIFwKKwkJCWxvY2tlZEdsb2JhbElTUiA9IFRSVUU7CQkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogVW5sb2NrcyBMb2NrR2xvYmFsSVNSIGlmIHlvdSBwcmV2aW91c2x5IGxvY2tlZCBpdCAqLworI2RlZmluZSBVTkxPQ0tHTE9CQUxJU1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAobG9ja2VkR2xvYmFsSVNSKSB7CQkJCSAgICAgICBcCisJCQlzcGluX3VubG9ja19pcnFyZXN0b3JlKCZMb2NrR2xvYmFsSVNSLCBmbGFncyk7IFwKKwkJCWxvY2tlZEdsb2JhbElTUiA9IEZBTFNFOwkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogTG9ja3MgTG9ja0dsb2JhbCBpZiB5b3UgaGF2bid0IGFscmVhZHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIExPQ0tHTE9CQUwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWlmICghbG9ja2VkR2xvYmFsKSB7CQkJCSAgICAgICBcCisJCQlzcGluX2xvY2soJkxvY2tHbG9iYWwpOwkJCSAgICAgICBcCisJCQlsb2NrZWRHbG9iYWwgPSBUUlVFOwkJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIFVubG9ja3MgTG9ja0dsb2JhbCBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLR0xPQkFMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKGxvY2tlZEdsb2JhbCkgewkJCQkgICAgICAgXAorCQkJc3Bpbl91bmxvY2soJkxvY2tHbG9iYWwpOwkJICAgICAgIFwKKwkJCWxvY2tlZEdsb2JhbCA9IEZBTFNFOwkJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIFVzZSB0aGlzIGF0IHRoZSBiZWdpbm5pbmcgb2YgZnVuY3Rpb25zIHdoZXJlIHlvdSBpbnRlbmQgdG8KKyAqICB1c2UgI0xPQ0tERVYvI1VOTE9DS0RFViwgI0xPQ0tERVZJU1IvI1VOTE9DS0RFVklTUiwKKyAqICAjTE9DS0dMT0JBTC8jVU5MT0NLR0xPQkFMLCAjTE9DS0dMT0JBTElTUi8jVU5MT0NLR0xPQkFMSVNSLgorICoKKyAqICBOb3RlIHRoYXQgX19hdHRyaWJ1dGVfXygodW51c2VkKSkgaXMgaG93I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aXMgcHJvZ3JhbSBpcyBkaXN0cmlidXRlZCBpbiB0aGUgaG9wZSB0aGF0IGl0IHdpbGwgYmUgdXNlZnVsLCBidXQKKyAqIFdJVEhPVVQgQU5ZIFdBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKyAqIE1FUkNIQU5UQUJJTElUWSBPUiBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSwgR09PRCBUSVRMRSBvcgorICogTk9OIElORlJJTkdFTUVOVC4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUKKyAqIGRldGFpbHMuCisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogVW5pc3lzIHRocmVhZCB1dGlsaXRpZXMgaGVhZGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKyNpZm5kZWYgX19VSVNUSFJFQURfSF9fCisjZGVmaW5lIF9fVUlTVEhSRUFEX0hfXworCisKKyNpbmNsdWRlICJsaW51eC9jb21wbGV0aW9uLmgiCisKK3N0cnVjdCB1aXN0aHJlYWRfaW5mbyB7CisJc3RydWN0IHRhc2tfc3RydWN0ICp0YXNrOworCWludCBpZDsKKwlpbnQgc2hvdWxkX3N0b3A7CisJc3RydWN0IGNvbXBsZXRpb24gaGFzX3N0b3BwZWQ7Cit9OworCisKKy8qIHJldHVybnMgMCBmb3IgZmFpbHVyZSwgMSBmb3Igc3VjY2VzcyAqLworaW50IHVpc3RocmVhZF9zdGFydCgKKwlzdHJ1Y3QgdWlzdGhyZWFkX2luZm8gKnRocmluZm8sCisJaW50ICgqdGhyZWFkZm4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X2Rpcl9lbnRyeSAqdGVzdF9wcm9jX2VudHJ5OworI2RlZmluZSBURVNUX1BST0NfRU5UUllfRk4gInRlc3QiCisjZW5kaWYKK3N0YXRpYyB1bnNpZ25lZCBsb25nIGxvbmcgY3ljbGVzX2JlZm9yZV93YWl0LCB3YWl0X2N5Y2xlczsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogbG9jYWwgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IHByb2NfaW5mb192YnVzX3Nob3coc3RydWN0IHNlcV9maWxlICptLCB2b2lkICp2KTsKK3N0YXRpYyBpbnQKK3Byb2NfaW5mb192YnVzX29wZW4oc3RydWN0IGlub2RlICppbm9kZSwgc3RydWN0IGZpbGUgKmZpbHApCit7CisJLyogcHJvY19pbmZvX3ZidXNfc2hvdyB3aWxsIGdyYWIgdGhpcyBmcm9tIHNlcV9maWxlLnByaXZhdGU6ICovCisJc3RydWN0IGJ1c19pbmZvICpidXMgPSBQREVfREFUQShpbm9kZSk7CisJcmV0dXJuIHNpbmdsZV9vcGVuKGZpbHAsIHByb2NfaW5mb192YnVzX3Nob3csIGJ1cyk7Cit9CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIHByb2NfaW5mb192YnVzX2ZvcHMgPSB7CisJLm9wZW4gPSBwcm9jX2luZm9fdmJ1c19vcGVuLAorCS5yZWFkID0gc2VxX3JlYWQsCisJLmxsc2VlayA9IHNlcV9sc2VlaywKKwkucmVsZWFzZSA9IHNpbmdsZV9yZWxlYXNlLAorfTsKKworc3RhdGljIHNzaXplX3QgdWlzbGliX3Byb2NfcmVhZF93cml0ZW9ubHkoc3RydWN0IGZpbGUgKmZpbGUsCisJCQkJCSAgY2hhciBfX3V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lYWQgaXMgbm90IE5VTEwiKTsKKwkJcmV0dXJuIENPTlRST0xWTV9SRVNQX0VSUk9SX0NISVBTRVRfU1RPUF9GQUlMRURfQlVTOworCX0KKwlpZiAoQnVzTGlzdENvdW50KSB7CisJCS8qIEJ1c0xpc3RIZWFkIGlzIE5VTEwsIGJ1dCBCdXNMaXN0Q291bnQgIT0gMCAqLworCQlMT0dFUlIoIkNPTlRST0xWTV9DSElQU0VUX1NUT1A6IEJ1c0xpc3RDb3VudCAhPSAwIik7CisJCXJldHVybiBDT05UUk9MVk1fUkVTUF9FUlJPUl9DSElQU0VUX1NUT1BfRkFJTEVEX0JVUzsKKwl9CisKKwkvKiBCdXNlcyBhcmUgc2h1dCBkb3duLiAqLworCXJldHVybiB2aXNvcmNoaXBzZXRfY2hpcHNldF9ub3RyZWFkeSgpOworfQorCitzdGF0aWMgaW50CitkZWxldGVfYnVzX2dsdWUoVTMyIGJ1c05vKQoreworCUNPTlRST0xWTV9NRVNTQUdFIG1zZzsKKworCWluaXRfbXNnX2hlYWRlcigmbXNnLCBDT05UUk9MVk1fQlVTX0RFU1RST1ksIDAsIDApOworCW1zZy5jbWQuZGVzdHJveUJ1cy5idXNObyA9IGJ1c05vOworCWlmIChkZXN0cm95X2J1cygmbXNnLCBOVUxMKSAhPSBDT05UUk9MVk1fUkVTUF9TVUNDRVNTKSB7CisJCUxPR0VSUigiZGVzdHJveV9idXMgZmFpbGVkLiBidXNObz0weCV4XG4iLCBidXNObyk7CisJCXJldHVybiAwOworCX0KKwlyZXR1cm4gMTsKK30KKworc3RhdGljIGludAorZGVsZXRlX2RldmljZV9nbHVlKFUzMiBidXNObywgVTMyIGRldk5vKQoreworCUNPTlRST0xWTV9NRVNTQUdFIG1zZzsKKworCWluaXRfbXNnX2hlYWRlcigmbXNnLCBDT05UUk9MVk1fREVWSUNFX0RFU1RST1ksIDAsIDApOworCW1zZy5jbWQuZGVzdHJveURldmljZS5idXNObyA9IGJ1c05vOworCW1zZy5jbWQuZG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91IHdhbnQgdG8gc2VuZCBhIGhpbnQgdG8gUHJvY2Vzc19JbmNvbWluZygpIHRoYXQKKyAqICB5b3VyIGRldmljZSBtaWdodCBoYXZlIG1vcmUgcmVxdWVzdHMuCisgKi8KK3ZvaWQKK3Vpc2xpYl9mb3JjZV9jaGFubmVsX2ludGVycnVwdChVMzIgYnVzTm8sIFUzMiBkZXZObykKK3sKKwlpZiAoZW5fc21hcnRfd2FrZXVwID09IDApCisJCXJldHVybjsKKwlpZiAoR29fUG9sbGluZ19EZXZpY2VfQ2hhbm5lbHMpCisJCXJldHVybjsKKwkvKiBUaGUgcG9pbnQgb2YgdXNpbmcgc2NoZWR1bGVfd29yaygpIGluc3RlYWQgb2YganVzdCBkb2luZworCSAqIHRoZSB3b3JrIGlubGluZSBpcyB0byBmb3JjZSBhIHNsaWdodCBkZWxheSBiZWZvcmUgd2FraW5nIHVwCisJICogdGhlIFByb2Nlc3NfSW5jb21pbmcoKSB0aHJlYWQuCisJICovCisJdG90X3dha2V1cF9jbnQrKzsKKwlzY2hlZHVsZV93b3JrKCZXb3JrX3dha2V1cF9wb2xsaW5nX2RldmljZV9jaGFubmVscyk7Cit9CitFWFBPUlRfU1lNQk9MX0dQTCh1aXNsaWJfZm9yY2VfY2hhbm5lbF9pbnRlcnJ1cHQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBNb2R1bGUgSW5pdCAmIEV4aXQgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgX19pbml0Cit1aXNsaWJfbW9kX2luaXQodm9pZCkKK3sKKworCUxPR0lORigiTU9OSVRPUkFQSVMiKTsKKworCUxPR0lORigic2l6ZW9mKHN0cnVjdCB1aXNjbWRyc3ApOiVsdSBieXRlc1xuIiwKKwkgICAgICAgKHVsb25nKS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D4KKyNpbmNsdWRlICJ1bmlrbG9nLmgiCisjaW5jbHVkZSAidWlzdXRpbHMuaCIKKyNpbmNsdWRlICJ1aXN0aHJlYWQuaCIKKworI2RlZmluZSBLSUxMKGEsIGIsIGMpIGtpbGxfcGlkKGZpbmRfdnBpZChhKSwgYiwgYykKKworLyogdGhpcyBpcyBzaG9ydGVyIHRoYW4gdXNpbmcgX19GSUxFX18gKGZ1bGwgcGF0aCBuYW1lKSBpbgorICogZGVidWcvaW5mby9lcnJvciBtZXNzYWdlcworICovCisjZGVmaW5lIENVUlJFTlRfRklMRV9QQyBVSVNMSUJfUENfdWlzdGhyZWFkX2MKKyNkZWZpbmUgX19NWUZJTEVfXyAidWlzdGhyZWFkLmMiCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIEV4cG9ydGVkIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyogcmV0dXJucyAwIGZvciBmYWlsdXJlLCAxIGZvciBzdWNjZXNzICovCitpbnQKK3Vpc3RocmVhZF9zdGFydChzdHJ1Y3QgdWlzdGhyZWFkX2luZm8gKnRocmluZm8sCisJCWludCAoKnRocmVhZGZuKSh2b2lkICopLCB2b2lkICp0aHJjb250ZXh0LCBjaGFyICpuYW1lKQoreworCXRocmluZm8tPnNob3VsZF9zdG9wID0gMDsKKwkvKiB1c2VkIHRvIHN0b3AgdGhlIHRocmVhZCAqLworCWluaXRfY29tcGxldGlvbigmdGhyaW5mby0+aGFzX3N0b3BwZWQpOworCXRocmluZm8tPnRhc2sgPSBrdGhyZWFkX2NyZWF0ZSh0aHJlYWRmbiwgdGhyY29udGV4dCwgbmFtZSwgTlVMTCk7CisJaWYgKElTX0VSUih0aHJpbmZvLT50YXNrKSkgeworCQl0aHJpbmZvLT5pZCA9IDA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xfcmVnaXN0ZXJfcmVxX2hhbmRsZXJfZXgoKSAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFV0aWxpdHkgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworaW50Cit1aXN1dGlsX2FkZF9wcm9jX2xpbmVfZXgoaW50ICp0b3RhbCwgY2hhciAqKmJ1ZmZlciwgaW50ICpidWZmZXJfcmVtYWluaW5nLAorCQkgICAgICBjaGFyICpmb3JtYXQsIC4uLikKK3sKKwl2YV9saXN0IGFyZ3M7CisJaW50IGxlbjsKKworCURCR0lORigiYnVmZmVyID0gMHglcCA6ICpidWZmZXIgPSAweCVwLlxuIiwgYnVmZmVyLCAqYnVmZmVyKTsKKwl2YV9zdGFydChhcmdzLCBmb3JtYXQpOworCWxlbiA9IHZzbnByaW50ZigqYnVmZmVyLCAqYnVmZmVyX3JlbWFpbmluZywgZm9ybWF0LCBhcmdzKTsKKwlpZiAobGVuID49ICpidWZmZXJfcmVtYWluaW5nKSB7CisJCSpidWZmZXIgKz0gKmJ1ZmZlcl9yZW1haW5pbmc7CisJCSp0b3RhbCArPSAqYnVmZmVyX3JlbWFpbmluZzsKKwkJKmJ1ZmZlcl9yZW1haW5pbmcgPSAwOworCQlMT0dFUlIoImJ5dGVzIHJlbWFpbmluZyBpcyB0b28gc21hbGwhXG4iKTsKKwkJcmV0dXJuIC0xOworCX0KKwkqYnVmZmVyX3JlbWFpbmluZyAtPSBsZW47CisJKmJ1ZmZlciArPSBsZW47CisJKnRvdGFsICs9IGxlbjsKKwlyZXR1cm4gbGVuOworfQorRVhQT1JUX1NZTUJPTF9HUEwodWlzdXRpbF9hZGRfcHJvY19saW5lX2V4KTsKKworaW50Cit1aXNjdHJsX3JlZ2lzdGVyX3JlcV9oYW5kb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V2LCB1MzIgc3RhdGUpOworc3RhdGljIHZvaWQgZG9EaXNrQWRkUmVtb3ZlKHN0cnVjdCB3b3JrX3N0cnVjdCAqd29yayk7CitzdGF0aWMgdm9pZCB2aXJ0aGJhX3NlcnZlcmRvd25fY29tcGxldGUoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKTsKKworc3RhdGljIHNzaXplX3QgaW5mb19wcm9jX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCisJCQkgICAgICBzaXplX3QgbGVuLCBsb2ZmX3QgKm9mZnNldCk7CitzdGF0aWMgc3NpemVfdCBycXd1X3Byb2Nfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWZmZXIsCisJCQkgICAgICAgc2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworc3RhdGljIHNzaXplX3QgZW5hYmxlX2ludHNfcmVhZChzdHJ1Y3QgZmlsZSAqZmlsZSwgY2hhciBfX3VzZXIgKmJ1ZmZlciwKKwkJCQlzaXplX3QgY291bnQsIGxvZmZfdCAqcHBvcyk7CitzdGF0aWMgc3NpemVfdCBlbmFibGVfaW50c193cml0ZShzdHJ1Y3QgZmlsZSAqZmlsZSwgY29uc3QgY2hhciBfX3VzZXIgKmJ1ZmZlciwKKwkJCQkgc2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBHbG9iYWxzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgcnNsdHFfd2FpdF91c2VjcyA9IDQwMDA7CS8qIERlZmF1bHQgNG1zICovCitzdGF0aWMgdW5zaWduZWQgaW50IE1heEJ1ZmZMZW47C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5lbCwgZGFyLT5pZCwgZGFyLT5sdW4pOworCWlmIChzZGV2KSB7CisJCWlmICghKGRhci0+YWRkKSkKKwkJCXNjc2lfcmVtb3ZlX2RldmljZShzZGV2KTsKKwl9IGVsc2UgaWYgKGRhci0+YWRkKSB7CisJCWVycm9yID0KKwkJICAgIHNjc2lfYWRkX2RldmljZShkYXItPnNob3N0LCBkYXItPmNoYW5uZWwsIGRhci0+aWQsCisJCQkJICAgIGRhci0+bHVuKTsKKwkJaWYgKGVycm9yKQorCQkJTE9HRVJSKCJGYWlsZWQgc2NzaV9hZGRfZGV2aWNlOiBob3N0X25vPSVkW2NoYW49JWQ6aWQ9JWQ6bHVuPSVkXVxuIiwKKwkJCSAgICAgZGFyLT5zaG9zdC0+aG9zdF9ubywgZGFyLT5jaGFubmVsLCBkYXItPmlkLAorCQkJICAgICBkYXItPmx1bik7CisJfSBlbHNlCisJCUxPR0VSUigiRmFpbGVkIHNjc2lfZGV2aWNlX2xvb2t1cDpbY2hhbj0lZDppZD0lZDpsdW49JWRdXG4iLAorCQkgICAgICAgZGFyLT5jaGFubmVsLCBkYXItPmlkLCBkYXItPmx1bik7CisJa2ZyZWUoZGFyKTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogREFSV29ya1EgSGFuZGxlciBUaHJlYWQgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQKK2RvRGlza0FkZFJlbW92ZShzdHJ1Y3Qgd29ya19zdHJ1Y3QgKndvcmspCit7CisJc3RydWN0IGRpc2thZGRyZW1vdmUgKmRhcjsKKwlzdHJ1Y3QgZGlza2FkZHJlbW92ZSAqdG1waGVhZDsKKwlpbnQgaSA9IDA7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKworCXNwaW5fbG9ja19pcnFzYXZlKCZEQVJXb3JrUUxvY2ssIGZsYWdzKTsKKwl0bXBoZWFkID0gREFSV29ya1FIZWFkOworCURBUldvcmtRSGVhZCA9IE5VTEw7CisJREFSV29ya1FTY2hlZCA9IDA7CisJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmREFSV29ya1FMb2NrLCBmbGFncyk7CisJd2hpbGUgKHRtcGhlYWQpIHsKKwkJZGFyID0gdG1waGVhZDsKKwkJdG1waGVhZCA9IGRhci0+bmV4dDsKKwkJU2VuZERpc2tBZGRSZW1vdmUoZGFyKTsKKwkJaSsrOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogUm91dGluZSB0byBhZGQgZW50cnkgdG8gREFSV29ya1EgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQKK3Byb2Nlc3NfZGlza19ub3RpZnkoc3RydWN0IFNjc2lfSG9zdCAqc2hvc3QsIHN0cnVjdCB1aXNjbWRyc3AgKmNtZHJzcCkKK3sKKwlzdHJ1Y3QgZGlza2FkZHJlbW92ZSAqZGFyOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKwlkYXIgPSBremFsbG9jKHNpemVvZihzdHJ1Y3QgZGlza2FkZHJlbW92ZSksIEdGUF9BVE9NSUMpOworCWlmIChkYXIpIHsKKwkJZGFyLT5hZGQgPSBjbWRyc3AtPmRpc2tub3RpZnkuYWRkOworCQlkYXItPnNob3N0ID0gc2hvc3Q7CisJCWRhci0+Y2hhbm5lbCA9IGNtZHJzcC0+ZGlza25vdGlmeS5jaGFubmVsOworCQlkYXItPmlkID0gY21kcnNwLT5kaXNrbm90aWZ5LmlkOworCQlkYXItPmx1biA9IGNtZHJzcC0+ZGlza25vdGlmeS5sdW47CisJCVFVRVVFX0RJU0tBRERSRU1PVkUoZGFyKTsKKwl9IGVsc2UgeworCQlMT0dFUlIoImttYWxsb2MgZmFpbGVkIGZvciBkYXIuIGhvc3Rfbm89JWRbY2hhbj0lZDppZD0lZDpsdW49JWRdXG4iLAorCQkgICAgIHNob3N0LT5ob3N0X25vLCBjbWRyc3AtPmRpc2tub3RpZnkuY2hhbm5lbCwKKwkJICAgICBjbWRyc3AtPmRpc2tub3RpZnkuaWQsIGNtZHJzcC0+ZGlza25vdGlmeS5sdW4pOworCX0KK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogUHJvYmUgUmVtb3ZlIEZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGlycXJldHVybl90Cit2aXJ0aGJhX0lTUihpbnQgaXJxLCB2b2lkICpkZXZfaWQpCit7CisJc3RydWN0IHZpcnRoYmFfaW5mbyAqdmlydGhiYWluZm8gPSAoc3RydWN0IHZpcnRoYmFfaW5mbyAqKSBkZXZfaWQ7CisJQ0hBTk5FTF9IRUFERVIgX19pb21lbSAqcENoYW5uZWxIZWFkZXI7CisJU0lHTkFMX1FVRVVFX0hFQURFUiBfX2lvbWVtICpwcWhkcjsKKwlVNjQgbWFzazsKKwl1bnNpZ25lZCBsb25nIGxvbmcgcmMxOworCisJaWYgKHZpcnRoYmFpbmZvID09IE5VTEwpCisJCXJldHVybiBJUlFfTk9ORTsKKwl2aXJ0aGJhaW5mby0+aW50ZXJydXB0c19yY3ZkKys7CisJcENoYW5uZWxIZWFkZXIgPSB2aXJ0aGJhaW5mby0+Y2hpbmZvLnF1ZXVlaW5mby0+Y2hhbjsKKwlpZiAoKChyZWFkcSgmcENoYW5uZWxIZWFkZXItPkZlYXR1cmVzKQorCSAgICAgICYgVUxUUkFfSU9fSU9WTV9JU19PS19XSVRIX0RSSVZFUl9ESVNBQkxJTkdfSU5UUykgIT0gMCkKKw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1bGUgSW5pdCAmIEV4aXQgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgX19pbml0Cit2aXJ0aGJhX3BhcnNlX2xpbmUoY2hhciAqc3RyKQoreworCURCR0lORigiSW4gdmlydGhiYV9wYXJzZV9saW5lICVzXG4iLCBzdHIpOworCXJldHVybiAxOworfQorCitzdGF0aWMgdm9pZCBfX2luaXQKK3ZpcnRoYmFfcGFyc2Vfb3B0aW9ucyhjaGFyICpsaW5lKQoreworCWNoYXIgKm5leHQgPSBsaW5lOworCisJUE9TVENPREVfTElOVVhfMihWSEJBX0NSRUFURV9FTlRSWV9QQywgUE9TVENPREVfU0VWRVJJVFlfSU5GTyk7CisJaWYgKGxpbmUgPT0gTlVMTCB8fCAhKmxpbmUpCisJCXJldHVybjsKKwl3aGlsZSAoKGxpbmUgPSBuZXh0KSAhPSBOVUxMKSB7CisJCW5leHQgPSBzdHJjaHIobGluZSwgJyAnKTsKKwkJaWYgKG5leHQgIT0gTlVMTCkKKwkJCSpuZXh0KysgPSAwOworCQlpZiAoIXZpcnRoYmFfcGFyc2VfbGluZShsaW5lKSkKKwkJCURCR0lORigiVW5rbm93biBvcHRpb24gJyVzJ1xuIiwgbGluZSk7CisJfQorCisJUE9TVENPREVfTElOVVhfMihWSEJBX0NSRUFURV9FWElUX1BDLCBQT1NUQ09ERV9TRVZFUklUWV9JTkZPKTsKK30KKworc3RhdGljIGludCBfX2luaXQKK3ZpcnRoYmFfbW9kX2luaXQodm9pZCkKK3sKKwlpbnQgZXJyb3I7CisJaW50IGk7CisKKwlMT0dJTkYoIkVudGVyaW5nIHZpcnRoYmFfbW9kX2luaXQuLi5cbiIpOworCisJUE9TVENPREVfTElOVVhfMihWSEJBX0NSRUFURV9FTlRSWV9QQywgUE9TVENPREVfU0VWRVJJVFlfSU5GTyk7CisJdmlydGhiYV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bnRyeSBkaXJlY3RvcnkKKyAqIGZvciB2aXJ0cGNpCisgKi8KK3N0YXRpYyBzdHJ1Y3QgcHJvY19kaXJfZW50cnkgKnZpcnRwY2lfcHJvY19kaXI7CisvKiB2aXJ0X3Byb2NfZW50cnkgaXMgdXNlZCB0byB0ZWxsIHZpcnRwY2kgdG8gYWRkL2RlbGV0ZSB2aGJhcy92bmljcy92YnVzZXMgKi8KK3N0YXRpYyBzdHJ1Y3QgcHJvY19kaXJfZW50cnkgKnZpcnRfcHJvY19lbnRyeTsKKy8qIGluZm9fcHJvY19lbnRyeSBpcyB1c2VkIHRvIHRlbGwgdmlydHBjaSB0byBkaXNwbGF5IGN1cnJlbnQgaW5mbworICoga2VwdCBpbiB0aGUgZHJpdmVyCisgKi8KK3N0YXRpYyBzdHJ1Y3QgcHJvY19kaXJfZW50cnkgKmluZm9fcHJvY19lbnRyeTsKKyNkZWZpbmUgVklSVF9QUk9DX0VOVFJZX0ZOICJ2aXJ0IgorI2RlZmluZSBJTkZPX1BST0NfRU5UUllfRk4gImluZm8iCisjZGVmaW5lIERJUl9QUk9DX0VOVFJZICJ2aXJ0cGNpIgorCitzdHJ1Y3QgdmlydHBjaV9idXNkZXYgeworCXN0cnVjdCBkZXZpY2UgdmlydHBjaV9idXNfZGV2aWNlOworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTG9jYWwgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW5saW5lCitpbnQgV0FJVF9GT1JfSU9fQ0hBTk5FTChVTFRSQV9JT19DSEFOTkVMX1BST1RPQ09MIF9faW9tZW0gICpjaGFucHRyKQoreworCWludCBjb3VudCA9IDEyMDsKKwl3aGlsZSAoY291bnQgPiAwKSB7CisKKwkJaWYgKFVMVFJ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cml2ZXI6JXAgZHJpdmVybmFtZTolc1xuIiwKKwkgICAgICAgQlVTX0lEKGRldl8pLCBkZXZfLCB2aXJ0cGNpZGV2LCBkZXZfLT5kcml2ZXIsCisJICAgICAgIGRldl8tPmRyaXZlci0+bmFtZSk7CS8qIFZFUkJPU0UvREVCVUcgKi8KKwlpZiAodmlydHBjaWRydikgeworCQkvKiBURU1QOiBhc3N1bWluZyB3ZSBoYXZlIG9ubHkgb25lIHN1Y2ggZHJpdmVyIGZvciBub3cgKi8KKwkJaWYgKHZpcnRwY2lkcnYtPnJlbW92ZSkKKwkJCXZpcnRwY2lkcnYtPnJlbW92ZSh2aXJ0cGNpZGV2KTsKKwkJdmlydHBjaWRldi0+bXlkcml2ZXIgPSBOVUxMOworCX0KKworCURCR0lORigiY2FsbGluZyBwdXRkZXZpY2VcbiIpOworCXB1dF9kZXZpY2UoZGV2Xyk7CisKKwlEQkdJTkYoIkxlYXZpbmdcbiIpOworCXJldHVybiAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBCdXMgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkIHZpcnRwY2lfYnVzX3JlbGVhc2Uoc3RydWN0IGRldmljZSAqZGV2KQoreworCS8qIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHdoZW4gdGhlIGxhc3QgcmVmZXJlbmNlIHRvIHRoZQorCSAqIGRldmljZSBpcyByZW1vdmVkCisJICovCisJREJHSU5GKCJJbiB2aXJ0cGNpX2J1c19yZWxlYXNlXG4iKTsKKwkvKiB3aGF0IGVsc2UgaXMgc3VwcG9zZWQgdG8gaGFwcGVuIGhlcmU/ICovCit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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UJPTF9HUEwodmlydHBjaV91bnJlZ2lzdGVyX2RyaXZlcik7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIHByb2MgZmlsZXN5c3RlbSBmdW5jdGlvbnMJCQkJCQkgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBwcmludF92YnVzX2luZm8geworCWludCAqbGVuZ3RoOworCWNoYXIgKmJ1ZjsKK307CisKK3N0YXRpYyBpbnQgcHJpbnRfdmJ1cyhzdHJ1Y3QgZGV2aWNlICp2YnVzLCB2b2lkICpkYXRhKQoreworCXN0cnVjdCBwcmludF92YnVzX2luZm8gKnAgPSAoc3RydWN0IHByaW50X3ZidXNfaW5mbyAqKSBkYXRhOworCWludCBsID0gKihwLT5sZW5ndGgpOworCisJKihwLT5sZW5ndGgpID0gbCArIHNwcmludGYocC0+YnVmICsgbCwgImJ1c19pZDolc1xuIiwgZGV2X25hbWUodmJ1cykpOworCXJldHVybiAwOwkJLyogbm8gZXJyb3IgKi8KK30KKworc3RhdGljIHNzaXplX3QgaW5mb19wcm9jX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCisJCQkgICAgICBzaXplX3QgbGVuLCBsb2ZmX3QgKm9mZnNldCkKK3sKKwlpbnQgbGVuZ3RoID0gMDsKKwlzdHJ1Y3QgdmlydHBjaV9kZXYgKnRtcHZwY2lkZXY7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlzdHJ1Y3QgcHJpbnRfdmJ1c19pbmZvIHByaW50cGFyYW07CisJY2hhciAqdmJ1ZjsKKwlsb2ZmX3QgcG9zID0gKm9mZnNldDsKKworCWlmIChwb3MgPCAwKQorCQlyZXR1cm4gLUVJTlZBTDsKKworCWlmIChwb3MgPiAwIHx8ICFsZW4pCisJCXJldHVybiAwOworCisJdmJ1ZiA9IGt6YWx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DB4ZjoKKwkJLyogZGVsZXRlIGFsbCB2aGJhcy92bmljcyAqLworCQlpID0gc3NjYW5mKGJ1ZiwgIiV4LSV4LSVkIiwgJnR5cGUsICZhY3Rpb24sICZidXNubyk7CisJCWlmIChpICE9IDMpCisJCQlicmVhazsKKwkJYnVzZGVscGFyYW1zLmJ1c05vID0gYnVzbm87CisJCWRlbGV0ZV9hbGxfdmlydCh0eXBlLCAmYnVzZGVscGFyYW1zKTsKKwkJcmV0dXJuIGNvdW50OwkvKiBzdWNjZXNzICovCisJZGVmYXVsdDoKKwkJYnJlYWs7CisJfQorCVBSSU5UX1VTQUdFX1JFVFVSTjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTW9kdWxlIEluaXQgJiBFeGl0IGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdCB2aXJ0cGNpX21vZF9pbml0KHZvaWQpCit7CisJaW50IHJldDsKKworCisJTE9HSU5GKCJNb2R1bGUgYnVpbGQ6IERhdGU6JXMgVGltZTolcy4uLlxuIiwgX19EQVRFX18sIF9fVElNRV9fKTsKKworCVBPU1RDT0RFX0xJTlVYXzIoVlBDSV9DUkVBVEVfRU5UUllfUEMsIFBPU1RDT0RFX1NFVkVSSVRZX0lORk8pOworCisJcmV0ID0gYnVzX3JlZ2lzdGVyKCZ2aXJ0cGNpX2J1c190eXBlKTsKKwkvKiBjcmVhdGVzIC9zeXMvYnVzL3Vpc3ZpcnRwY2kgd2hpY2ggY29udGFpbnMgZGV2aWNlcyAmCisJICogZHJpdmVycyBkaXJlY3RvcnkKKwkgKi8KKwlpZiAocmV0KSB7CisJCUxPR0VSUigiYnVzX3JlZ2lzdGVyICoqKipGQUlMRUQ6JWRcbiIsIHJldCk7CisJCVBPU1RDT0RFX0x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JhbnNmZXJyZWQKKyAqICAgZGlza19pbmRleAorICogICBmaWxlX25hbWUKKyAqICAgZ2V0X2NvbnRpZ3VvdXNfY29udHJvbHZtX3BheWxvYWQgIGZ1bmN0aW9uIHRvIGNhbGwgd2hlbiBzcGFjZSBpcyBuZWVkZWQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBwYXlsb2FkIGFyZWEKKyAqICAgY29udHJvbHZtX3Jlc3BvbmRfd2l0aF9wYXlsb2FkICAgIGZ1bmN0aW9uIHRvIGNhbGwgdG8gc2VuZCBlYWNoIGNvbnRyb2x2bQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UgY29udGFpbmluZyBmaWxlIGRhdGEgYXMgdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXlsb2FkOyByZXR1cm5zIEZBTFNFIG9ubHkgaWYgdGhlCisgKgkJCQkgICAgICAgcGF5bG9hZCBidWZmZXIgd2FzIGZyZWVkIGlubGluZQorICogICBkdW1wX2Z1bmMgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG8gZHVtcCBjb250ZXh0IGRhdGEgaW4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh1bWFuLXJlYWRhYmxlIGZvcm1hdAorICoKKyAqICBSZXR1cm5zIFRSVUUgaWZmIHRoZSBmaWxlIHRyYW5zZmVyIHJlcXVlc3QgaGFzIGJlZW4gc3VjY2Vzc2Z1bGx5IGluaXRpYXRlZCwKKyAqICBvciBGQUxTRSB0byBpbmRpY2F0ZSBmYWlsdXJlLgorICovCitCT09MCitmaWxleGZlcl9nZXRGaWxlKENPTlRST0xWTV9NRVNTQUdFX0hFQURFUiAqbXNnSGRyLAorCQkgdTY0IGZpbGVfcmVxdWVzdF9udW1iZXIsCisJCSB1aW50IHVwbGlua19pbmRleCwKKwkJIHVpbnQgZGlza19pbmRleCwKK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GUgbG9jYWwKKyAqICAgZGlza19pbmRleCAgICAgICAgICAgZmlsZXN5c3RlbQorICogICBmaWxlX25hbWUKKyAqICAgaW5pdF9jb250ZXh0ICAgICAgICAgZnVuY3Rpb24gdG8gY2FsbCB0byBpbml0aWFsaXplIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICA8cmVxX2NvbnRleHRfYnl0ZXM+LXNpemVkIHN0b3JhZ2UgYXJlYSByZXR1cm5lZCBieQorICogICAgICAgICAgICAgICAgICAgICAgICB0aGlzIGZ1bmM7IG5vdGUgdGhhdCBpdCB3b3VsZCBOT1QgYmUgc3VmZmljaWVudCB0bworICogICAgICAgICAgICAgICAgICAgICAgICBhbGxvdyB0aGUgY2FsbGVyIHRvIGluaXRpYWxpemUgdGhpcyB1cG9uIHJldHVybiwgYXMKKyAqICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHRoZSBvdGhlciB1c2VyLXN1cHBsaWVkIGNhbGxiYWNrcyBtaWdodCBoYXZlCisgKiAgICAgICAgICAgICAgICAgICAgICAgIGFscmVhZHkgYmVlbiBjYWxsZWQgYnkgdGhlbgorICogICBnZXRfY29udHJvbHZtX2ZpbGVkYXRhICAgZnVuY3Rpb24gdG8gY2FsbCB0byBvYnRhaW4gbW9yZSBkYXRhIGZvciB0aGUgZmlsZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVpbmcgd3JpdHRlbjsgcmVmZXIgdG8gZ2V0X2NvbnRyb2x2bV9maWxlZGF0YSgpCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB2aXNvcmNoaXBzZXRfbWFpbi5jIGZvciBhIGNvbXBsZXRlIGRlc2NyaXB0aW9uCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBwYXJhbWV0ZXJzCisgKiAgIGNvbnRyb2x2bV9lbmRfcHV0RmlsZSAgICBmdW5jdGlvbiB0byBjYWxsIHRvIGluZGljYXRlIHRoYXQgY3JlYXRpb24gb2YgdGhlCisgKiA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dBUlJBTlRZOyB3aXRob3V0IGV2ZW4gdGhlIGltcGxpZWQgd2FycmFudHkgb2YKKyAqIE1FUkNIQU5UQUJJTElUWSBPUiBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSwgR09PRCBUSVRMRSBvcgorICogTk9OIElORlJJTkdFTUVOVC4gIFNlZSB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgZm9yIG1vcmUKKyAqIGRldGFpbHMuCisgKi8KKworLyoqIEBmaWxlICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqICBUaGlzIGRlc2NyaWJlcyB0aGUgaW50ZXJmYWNlcyBuZWNlc3NhcnkgZm9yIGEgc2ltcGxlIC9wcm9jIGZpbGUKKyAqICBpbXBsZW1lbnRhdGlvbiBmb3IgYSBkcml2ZXIuCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCisKKyNpZm5kZWYgX19FQVNZUFJPQ19IX18KKyNkZWZpbmUgX19FQVNZUFJPQ19IX18KKworI2luY2x1ZGUgInRpbXNrbW9kLmgiCisKKworc3RydWN0IGVhc3lwcm9jX2RyaXZlcl9pbmZvIHsKKwlzdHJ1Y3QgcHJvY19kaXJfZW50cnkgKlByb2NEaXI7CisJc3RydWN0IHByb2NfZGlyX2VudHJ5ICpQcm9jRHJpdmVyRGlyOworCXN0cnVjdCBwcm9jX2Rpcl9lbnRyeSAqUHJvY0RyaXZlckRpYWdGaWxlOworCXN0cnVjdCBwcm9jX2Rpcl9lbnRyeSAqUHJvY0RldmljZURpcjsKKwljaGFyICpQcm9jSWQ7CisJdm9pZCAoKlNob3dfZGV2aWNlX2luZm8pKHN0cnVjdCBzZXFfZmlsZSAqc2VxLCB2b2lkICpwKTsKKwl2b2lkICgqU2hvd19kcml2ZX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liU2NoZWR1bGVDb21tYW5kKHByaXYsIFdMQU5fQ01EX0NPTkZJR1VSRV9GSUxURVIsIE5VTEwpOworCisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnByaXYtPmxvY2ssIGZsYWdzKTsKKwl9Cit9CisKK3ZvaWQgdm50X2NvbmZpZ3VyZV9maWx0ZXIoc3RydWN0IHZudF9wcml2YXRlICpwcml2KQoreworCXN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBwcml2LT5kZXY7CisJc3RydWN0IHZudF9tYW5hZ2VyICptZ210ID0gJnByaXYtPnZudF9tZ210OwogCXN0cnVjdCBuZXRkZXZfaHdfYWRkciAqaGE7Ci0JdTMyIG1jX2ZpbHRlclsyXTsKLQlpbnQgaWk7Ci0JdTggcGJ5RGF0YVs4XSA9IHsweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmfTsKLQl1OCBieVRtcE1vZGUgPSAwOworCXU2NCBtY19maWx0ZXIgPSAwOworCXU4IHRtcCA9IDA7CiAJaW50IHJjOwogCi0Jc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7Ci0gICAgcmMgPSBDT05UUk9MbnNSZXF1ZXN0SW4ocERldmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1RZUEVfUkVBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHX1JDUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1JFUVVFU1RfTUFDUkVHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5VG1wTW9kZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgaWYgKHJjID09IDApIHBEZXZpY2UtPmJ5UnhNb2RlID0gYnlUbXBNb2RlOworCXJjID0gQ09OVFJPTG5zUmVxdWVzdEluKHByaXYsIE1FU1N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Q1JFRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBieURhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBwRGV2aWNlLT5ieVJ4TW9kZSB8PSAoUkNSX01VTFRJQ0FTVHxSQ1JfQlJPQURDQVNUKTsKLSAgICB9Ci0gICAgZWxzZSB7Ci0gICAgICAgIG1lbXNldChtY19maWx0ZXIsIDAsIHNpemVvZihtY19maWx0ZXIpKTsKLQluZXRkZXZfZm9yX2VhY2hfbWNfYWRkcihoYSwgZGV2KSB7Ci0gICAgICAgICAgICBpbnQgYml0X25yID0gZXRoZXJfY3JjKEVUSF9BTEVOLCBoYS0+YWRkcikgPj4gMjY7Ci0gICAgICAgICAgICBtY19maWx0ZXJbYml0X25yID4+IDVdIHw9IGNwdV90b19sZTMyKDEgPDwgKGJpdF9uciAmIDMxKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChpaSA9IDA7IGlpIDwgNDsgaWkrKykgewotICAgICAgICAgICAgIE1BQ3ZXcml0ZU11bHRpQWRkcihwRGV2aWNlLCBpaSwgKigodTggKikmbWNfZmlsdGVyWzBdICsgaWkpKTsKLSAgICAgICAgICAgICBNQUN2V3JpdGVNdWx0aUFkZHIocERldmljZSwgaWkrIDQsICooKHU4ICopJm1jX2ZpbHRlclsxXSArIGlpKSk7Ci0gICAgICAgIH0KLSAgICAgICAgcERldmljZS0+YnlSeE1vZGUgJj0gfihSQ1JfVU5JQ0FTVCk7Ci0gICAgICAgIHBEZXZpY2UtPmJ5UnhNb2RlIHw9IChSQ1JfTVVMVElDQVNUfFJDUl9CUk9BRENBU1QpOwotICAgIH0KKwlpZiAoZGV2LT5mbGFncyAmIElGRl9QUk9NSVNDKSB7IC8qIHNldCBwcm9taXNjdW91cyBtb2RlICovCisJCURCR19QUlQoTVNHX0xFVkVMX0VSUiwgS0VSTl9OT1RJQ0UKKwkJCSIlczogUHJvb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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogI2RlZmluZSBWQUxJRF9QQVJBTShDKSBcCiAJeyBcCi0JCWlmICghKEMpKSBcCi0JCXsgXAorCQlpZiAoIShDKSkgeyBcCiAJCQlwcmludGsoS0VSTl9JTkZPICJXaXJlbGVzcywgcGFyYW1ldGVyIGVycm9yOiBcIiVzXCJcbiIsICNDKTsgXAogCQkJZ290byBmYWlsZWQ7IFwKIAkJfSBcCkBAIC0xNDIsNyArMTI2LDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKglsb2NhbCBmdW5jdGlvbnMKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2lzcl9oYW5kbGVyKCB1bnNpZ25lZCBsb25nIHAgKTsKK3ZvaWQgd2xfaXNyX2hhbmRsZXIodW5zaWduZWQgbG9uZyBwKTsKIAogI2lmIDAgLy9TQ1VMTF9VU0VfUFJPQyAvKiBkb24ndCB3YXN0ZSBzcGFjZSBpZiB1bnVzZWQgKi8KIHN0YXRpYyBpbnQgc2N1bGxfcmVhZF9wcm9jbWVtKHN0cnVjdCBzZXFfZmlsZSAqbSwgdm9pZCAqdik7CkBAIC0xNjgsNyArMTUyLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBtb2R1bGUgcGFyYW1ldGVyIGRlZmluaXRpb25zIC0gc2V0IHdpdGggJ2luc21vZCcKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgcF91MTYgICAg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S5oPgotI2VuZGlmICAvKiBCVVNfUENJICovCi0KKyNlbmRpZiAvKiBCVVNfUENJICovCiAKICNpZiBIQ0ZfRU5DQVAKICNkZWZpbmUgTVRVX01BWCAoSENGX01BWF9NU0cgLSBFVEhfSExFTiAtIDgpCkBAIC0xMjEsMTcgKzEwMywxNSBAQAogI2RlZmluZSBNVFVfTUFYIChIQ0ZfTUFYX01TRyAtIEVUSF9ITEVOKQogI2VuZGlmCiAKLS8vc3RhdGljIGludCBtdHUgPSBNVFVfTUFYOwotLy9NT0RVTEVfUEFSTShtdHUsICJpIik7Ci0vL01PRFVMRV9QQVJNX0RFU0MobXR1LCAiTVRVIik7Ci0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBtYWNyb3MKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAjZGVmaW5lIEJMT0NLX0lOUFVUKGJ1ZiwgbGVuKSBcCi0gICAgZGVzYy0+YnVmX2FkZHIgPSBidWY7IFwKLSAgICBkZXNjLT5CVUZfU0laRSA9IGxlbjsgXAotICAgIHN0YXR1cyA9IGhjZl9yY3ZfbXNnKCYobHAtPmhjZkN0eCksIGRlc2MsIDApCisJZG8geyBcCisJCWRlc2MtPmJ1Zl9hZGRyID0gYnVmOyBcCisJCWRlc2MtPkJVRl9TSVpFID0gbGVuOyBcCisJCXN0YXR1cyA9IGhjZl9yY3ZfbXNnKCYobHAtPmhjZkN0eCksIGRlc2MsIDApOyBcCisJfSB3aGlsZSAoMCkKIAogI2RlZmluZSBCTE9DS19JTlBVVF9ETUEoYnVmLCBsZW4pIG1lbWNweSggYnVmLCBkZXNjX25leHQtPmJ1Zl9hZGRyLCBwa3RsZW4gKQogCkBAIC0xNTgsMjAgKzEzOCwxMiBAQAogICogICAgICBlcnJubyB2YWx1ZSBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX2luaXQoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX2luaXQoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLS8vICAgIHVuc2lnbmVkIGxvbmcgICAgICAgZmxhZ3M7Ci0vLyAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgICpscCA9IHdsX3ByaXYoZGV2KTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7CisJcmV0dXJuIDA7Cit9CQkJCS8qIHdsX2luaXQgKi8KIAotICAgIERCR19QQVJBTSggRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldiApOwotCi0gICAgLyogTm90aGluZyB0byBkbywgYnV0IGdyYWIgdGhlIHNwaW5sb2NrIGFueXdheSBqdXN0IGluIGNhc2Ugd2UgZXZlciBuZWVkCi0gICAgICAgdGhpcyByb3V0aW5lICovCi0vLyAgd2xfbG9jayggbHAsICZmbGFncyApOwotLy8gIHdsX3VubG9jayggbHAsICZmbGFncyApOwotCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2luaXQKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xOTMsMTcgKzE2NSwyMCBAQAogICogICAgICBlcnJubyBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTIyNCw0OCArMTk5LDQ3IEBACiAgKiAgICAgIHN0YXRpc3RpY3MuCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICp3bF9zdGF0cyggc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyAqd2xfc3RhdHMoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50OwotI2VuZGlmICAvKiBVU0VfV0RTICovCi0gICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgIGZsYWdzOwotICAgIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICAgICAqcFN0YXRzOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICAgICAqbHAgPSB3bF9wcml2KGRldik7CisJaW50IGNvdW50OworI2VuZGlmIC8qIFVTRV9XRFMgKi8KKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICpwU3RhdHM7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOwogCi0gICAgLy9EQkdfUEFSQU0oIERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYgKTsKKwkvKkRCR19QQVJBTSggRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldiApOyAqLwogCi0gICAgcFN0YXRzID0gTlVMTDsKKwlwU3RhdHMgPSBOVUxMOwog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AgICAgICAgcFN0YXRzID0gJiggbHAtPnN0YXRzICk7Ci0gICAgfQorCS8qIElmIHBTdGF0cyBpcyBzdGlsbCBOVUxMLCB0aGVuIHRoZSBkZXZpY2UgaXMgbm90IGEgV0RTIHBvcnQgKi8KKwlpZiAocFN0YXRzID09IE5VTEwpCisJCXBTdGF0cyA9ICYobHAtPnN0YXRzKTsKIAotICAgIHdsX3VubG9jayggbHAsICZmbGFncyApOworCXdsX3VubG9jayhscCwgJmZsYWdzKTsKIAotICAgIHJldHVybiBwU3RhdHM7Ci19IC8vIHdsX3N0YXRzCisJcmV0dXJuIHBTdGF0czsKK30JCQkJLyogd2xfc3RhdHMgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTI4OCw3NSArMjYyLDc3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50IHdsX29wZW4oc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBpbnQgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEhDRl9TVUNDRVNTOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgKmxwID0gd2xfcHJpdihkZXYpOwotICAgIHVuc2lnbmVkIGxvbmcgICAgICAgZmxhZ3M7CisJaW50IHN0YXR1cyA9IEhDRl9TVUNDRVNTOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOwogCi0gICAgd2xfbG9jayggbHAsICZmbGFncyApOworCXdsX2xvY2sobHAsICZmbGFncyk7CiAKICNpZmRlZiBVU0VfUlRTCi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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTM3Nyw3MyArMzUzLDcwIEBACiAgKiAgICAgIGVycm5vIG90aGVyd2lzZQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfY2xvc2UoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX2Nsb3NlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgc3RydWN0IHdsX3ByaXZhdGUgICAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOwogCi0gICAgREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOworCURCR19QQVJBTShEYmdJbmZvLCAiZGV2IiwgIiVzICgweCVwKSIsIGRldi0+bmFtZSwgZGV2KTsKIAotICAgIC8qIE1hcmsgdGhlIGFkYXB0ZXIgYXMgYnVzeSAqLwotICAgIG5ldGlmX3N0b3BfcXVldWUoIGRldiApOwotICAgIFdMX1dEU19ORVRJRl9TVE9QX1FVRVVFKCBscCApOworCS8qIE1hcmsgdGhlIGFkYXB0ZXIgYXMgYnVzeSAqLworCW5ldGlmX3N0b3BfcXVldWUoZGV2KTsKKwlXTF9XRFNfTkVUSUZfU1RPUF9RVUVVRShscCk7CiAKLSAgICBuZXRpZl9jYXJyaWVyX29mZiggZGV2ICk7Ci0gICAgV0xfV0RTX05FVElGX0NBUlJJRVJfT0ZGKCBscCApOworCW5ldGlmX2NhcnJpZXJfb2ZmKGRldik7CisJV0xfV0RTX05FVElGX0NBUlJJRVJfT0ZGKGxwKTsKIAotICAgIC8qIFNodXRkb3duIHRoZSB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LnBhcmVudCwgIiVzIiwgaW5mby0+YnVzX2luZm8pOwotCS8vc3RybGNweShpbmZvLT5idXNfaW5mbywgZGV2LT5kZXYucGFyZW50LT5idXNfaWQsCi0JLy8Jc2l6ZW9mKGluZm8tPmJ1c19pbmZvKSk7Ci0gICAgfSBlbHNlIHsKLQlzbnByaW50ZihpbmZvLT5idXNfaW5mbywgc2l6ZW9mKGluZm8tPmJ1c19pbmZvKSwKLQkJIlBDTUNJQSBGSVhNRSIpOwotLy8JCSAgICAiUENNQ0lBIDB4JWx4IiwgcHJpdi0+aHcuaW9iYXNlKTsKLSAgICB9Ci19IC8vIHdsX2dldF9kcnZpbmZvCisJaWYgKGRldi0+ZGV2LnBhcmVudCkgeworCQlkZXZfc2V0X25hbWUoZGV2LT5kZXYucGFyZW50LCAiJXMiLCBpbmZvLT5idXNfaW5mbyk7CisJfSBlbHNlIHsKKwkJc25wcmludGYoaW5mby0+YnVzX2luZm8sIHNpemVvZihpbmZvLT5idXNfaW5mbyksCisJCQkgIlBDTUNJQSBGSVhNRSIpOworCX0KK30JCQkJLyogd2xfZ2V0X2RydmluZm8gKi8KIAogc3RhdGljIHN0cnVjdCBldGh0b29sX29wcyB3bF9ldGh0b29sX29wcyA9IHsKLSAgICAuZ2V0X2RydmluZm8gPSB3bF9nZXRfZHJ2aW5mbywKLSAgICAuZ2V0X2xpbmsgPSBldGh0b29sX29wX2dldF9saW5rLAorCS5nZXRfZHJ2aW5mbyA9IHdsX2dldF9kcnZpbmZvLAorCS5nZXRfbGluayA9IGV0aHRvb2xfb3BfZ2V0X2xpbmssCiB9OwogCi0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgl3bF9pb2N0bCgpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNDY0LDgxICs0MzcsODYgQEAKICAqICAgICAgZXJybm8gdmFsdWUgb3RoZXJ3aXNlCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9pb2N0bCggc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCApCitpbnQgd2xfaW9jdGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCkKIHsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgKmxwID0gd2xfcHJpdihkZXYpOwotICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIGZsYWdzOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgIHJldCA9IDA7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJaW50IHJldCA9IDA7CiAKLSAgICBEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7Ci0gICAgREJHX1BBUkFNKERiZ0luZm8sICJycSIsICIweCVwIiwgcnEpOwotICAgIERCR19QQVJBTShEYmdJbmZvLCAiY21kIiwgIjB4JTA0eCIsIGNtZCk7CisJREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOworCURCR19QQVJBTShEYmdJbmZvLCAicnEiLCAiMHglcCIsIHJxKTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgImNtZCIsICIweCUwNHgiLCBjbWQpOwogCi0gICAgd2xfbG9jayggbHAsICZmbGFncyApOworCXdsX2xvY2sobHAsICZmbGFncyk7CiAKLSAgICB3bF9hY3RfaW50X29mZiggbHAgKTsKKwl3bF9hY3RfaW50X29mZihscCk7CiAKICN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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogI2lmZGVmIENPTkZJR19ORVRfUE9MTF9DT05UUk9MTEVSCi12b2lkIHdsX3BvbGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKK3N0YXRpYyB2b2lkIHdsX3BvbGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgdW5zaWduZWQgbG9uZyBmbGFnczsKLSAgICBzdHJ1Y3QgcHRfcmVncyByZWdzOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCXN0cnVjdCBwdF9yZWdzIHJlZ3M7CiAKLSAgICB3bF9sb2NrKCBscCwgJmZsYWdzICk7Ci0gICAgd2xfaXNyKGRldi0+aXJxLCBkZXYsICZyZWdzKTsKLSAgICB3bF91bmxvY2soIGxwLCAmZmxhZ3MgKTsKKwl3bF9sb2NrKGxwLCAmZmxhZ3MpOworCXdsX2lzcihkZXYtPmlycSwgZGV2LCAmcmVncyk7CisJd2xfdW5sb2NrKGxwLCAmZmxhZ3MpOwogfQogI2VuZGlmCiAKQEAgLTU1OSw1MyArNTM3LDU0IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3R4X3RpbWVvdXQoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQordm9pZCB3bF90eF90aW1lb3V0KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7CiAjaWZkZWYgVVNFX1dEUwotICAgIGludCAgICAgICAgICAgICAgICAgICAgIGNvdW50OwotI2VuZGlmICAvKiBVU0VfV0RTICovCi0gICAgdW5zaWduZWQgbG9uZy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ydCAqLwotICAgIGlmKCBwU3RhdHMgPT0gTlVMTCApIHsKLQlwU3RhdHMgPSAmKCBscC0+c3RhdHMgKTsKLSAgICB9CisJLyogSWYgcFN0YXRzIGlzIHN0aWxsIE5VTEwsIHRoZW4gdGhlIGRldmljZSBpcyBub3QgYSBXRFMgcG9ydCAqLworCWlmIChwU3RhdHMgPT0gTlVMTCkKKwkJcFN0YXRzID0gJihscC0+c3RhdHMpOwogCi0gICAgLyogQWNjdW11bGF0ZSB0aGUgdGltZW91dCBlcnJvciAqLwotICAgIHBTdGF0cy0+dHhfZXJyb3JzKys7CisJLyogQWNjdW11bGF0ZSB0aGUgdGltZW91dCBlcnJvciAqLworCXBTdGF0cy0+dHhfZXJyb3JzKys7CiAKLSAgICB3bF91bmxvY2soIGxwLCAmZmxhZ3MgKTsKLX0gLy8gd2xfdHhfdGltZW91dAorCXdsX3VubG9jayhscCwgJmZsYWdzKTsKK30JCQkJLyogd2xfdHhfdGltZW91dCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNjI2LDEwMyArNjA1LDEwNSBAQAogICogICAgICAxIG9uIGVycm9yCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9zZW5kKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQoraW50IHdsX3NlbmQoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewogCi0gICAgaW50ICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgREVTQ19TVFJDVCAgICAgICAgICAqZGVzYzsKLSAgICBXVkxBTl9MRlJBTUUgICAgICAgICp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5VTEwpIHsKKwkJCWxwLT50eEYuc2tiID0gdHhGLT5mcmFtZS5za2I7CisJCQlscC0+dHhGLnBvcnQgPSB0eEYtPmZyYW1lLnBvcnQ7CiAKLSAgICAgICAgICAgIHR4Ri0+ZnJhbWUuc2tiICA9IE5VTEw7Ci0gICAgICAgICAgICB0eEYtPmZyYW1lLnBvcnQgPSAwOworCQkJdHhGLT5mcmFtZS5za2IgPSBOVUxMOworCQkJdHhGLT5mcmFtZS5wb3J0ID0gMDsKIAotICAgICAgICAgICAgbGlzdF9kZWwoICYoIHR4Ri0+bm9kZSApKTsKLSAgICAgICAgICAgIGxpc3RfYWRkKCBlbGVtZW50LCAmKCBscC0+dHhGcmVlICkpOworCQkJbGlzdF9kZWwoJih0eEYtPm5vZGUpKTsKKwkJCWxpc3RfYWRkKGVsZW1lbnQsICYobHAtPnR4RnJlZSkpOwogCi0gICAgICAgICAgICBscC0+dHhRX2NvdW50LS07CisJCQlscC0+dHhRX2NvdW50LS07CiAKLSAgICAgICAgICAgIGlmKCBscC0+dHhRX2NvdW50IDwgVFhfUV9MT1dfV0FURVJfTUFSSyApIHsKLSAgICAgICAgICAgICAgICBpZiggbHAtPm5ldGlmX3F1ZXVlX29uID09IEZBTFNFICkgewotICAgICAgICAgICAgICAgICAgICBEQkdfVFgoIERiZ0luZm8sICJLaWNrc3RhcnRpbmcgUTogJWRcbiIsIGxwLT50eFFfY291bnQgKTsKLSAgICAgICAgICAgICAgICAgICAgbmV0aWZfd2FrZV9xdWV1ZSggbHAtPmRldiApOwotICAgICAgICAgICAgICAgICAgICBXTF9XRFNfTkVUSUZfV0FLRV9RVUVVRSggbHAgKTsKLSAgICAgICAgICAgICAgICAgICAgbHAtPm5ldGlmX3F1ZXVlX29uID0gVFJVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9CisJCQlpZiAobHAtPnR4UV9jb3VudCA8IFRYX1FfTE9XX1dBVEVSX01BUkspIHs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JCWxwLT50eEYucG9ydCA9IDA7CisJfQogCi0gICAgcmV0dXJuIFRSVUU7Ci19IC8vIHdsX3NlbmQKKwlyZXR1cm4gVFJVRTsKK30JCQkJLyogd2xfc2VuZCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNzQ0LDc1ICs3MjUsNzQgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHgoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGludCBwb3J0ICkKK2ludCB3bF90eChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBpbnQgcG9ydCkKIHsKLSAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICBmbGFnczsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgICAgICAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgV1ZMQU5fTEZSQU1FICAgICAgICAgICAgKnR4RiA9IE5VTEw7Ci0gICAgc3RydWN0IGxpc3RfaGVhZCAgICAgICAgKmVsZW1lbnQ7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgPSB3bF9wcml2KGRldik7CisJV1ZMQU5fTEZSQU1FICp0eEYgPSBOVUxMOworCXN0cnVjdCBsaXN0X2hlYWQgKmVsZW1lbnQ7CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTgzNSw2NyArODE1LDY4IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50IHdsX3J4KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBzdHJ1Y3Qgc2tfYnVmZiAgICAgICAgICAqc2tiOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICpscCA9IHdsX3ByaXYoZGV2KTsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgaGNmXzE2ICAgICAgICAgICAgICAgICAgcGt0bGVuOwotICAgIGhjZl8xNiAgICAgICAgICAgICAgICAgIGhmc19zdGF0OwotICAgIERFU0NfU1RSQ1QgICAgICAgICAgICAgICpkZXNjOworCWludCBwb3J0OworCXN0cnVjdCBza19idWZmICpza2I7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOworCWludCBzdGF0dXM7CisJaGNmXzE2IHBrdGxlbjsKKwloY2ZfMTYgaGZzX3N0YXQ7CisJREVTQ19TVFJDVCAqZGVzYzsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7CisJREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2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0tCKHBrdGxlbik7Ci0gICAgICAgICAgICBpZiAoc2tiICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIG5ldGRldiBiYXNlZCBvbiB0aGUgcG9ydCAqLwotICAgICAgICAgICAgICAgIHN3aXRjaCggcG9ydCApIHsKKwkJcGt0bGVuID0gbHAtPmhjZkN0eC5JRkJfUnhMZW47CisJCWlmIChwa3RsZW4gIT0gMCkgeworCQkJc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7CisJCQlpZiAoc2tiICE9IE5VTEwpIHsKKwkJCQkvKiBTZXQgdGhlIG5ldGRldiBiYXNlZCBvbiB0aGUgcG9ydCAqLworCQkJCXN3aXRjaCAocG9ydCkgewogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgY2FzZSA1OgotICAgICAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJY2FzZSAxOgorCQkJCWNhc2UgMjoKKwkJCQljYXNlIDM6CisJCQkJY2FzZSA0OgorCQkJCWNhc2UgNToKKwkJCQljYXNlIDY6CisJCQkJCXNrYi0+ZGV2ID0gbHAtPndkc19wb3J0W3BvcnQgLSAxXS5kZXY7CisJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWNhc2UgMDoKKwkJCQlkZWZhdWx0OgorCQkJCQlza2ItPmRldiA9IGRldjsKKwkJCQkJYnJlYWs7CisJCQkJfQogCi0gICAgICAgICAgICAgICAgZGVzYyA9ICYoIGxwLT5kZXNjX3J4ICk7CisJCQkJZGVzYyA9ICYobHAtPmRlc2NfcngpOwogCi0gICAgICAgICAgICAgICAgZGVzYy0+bmV4dF9kZXNjX2FkZHIgPSBOVUxMOworCQkJCWRlc2MtPm5leHRfZGVzY19hZGRyID0gTlVMTDsKIAogLyoKICNkZWZpbmUgQkxPQ0tfSU5QVVQoYnVmLCBsZW4pIFwKQEAgLTkwNCw2NyArODg1LDczIEBACiAgICAgc3RhdHVzID0gaGNmX3Jjdl9tc2coJihscC0+aGNmQ3R4KSwgZGVzYywgMCkKICovCiAKLSAgICAgICAgICAgICAgICBHRVRfUEFDS0VUKCBza2ItPmRldiwgc2tiLCBwa3RsZW4gKTsKKwkJCQlHRVRfUEFDS0VUKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICBpZiggc3RhdHVzID09IEhDRl9TVUNDRVNTICkgewotICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJaWYgKHN0YXR1cyA9PSBIQ0ZfU1VDQ0VTUykgeworCQkJCQluZXRpZl9yeChza2IpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfcGFja2V0cysrOwotICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKLSAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9ieXRlcyArPSBwa3RsZW47Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLworCQkJCQllbHNlIHsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X3BhY2tldHMrKzsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICBkZXYtPmxhc3RfcnggPSBqaWZmaWVzOworCQkJCQlkZXYtPmxhc3RfcnggPSBqaWZmaWVzOwogCiAjaWZkZWYgV0lSRUxFU1NfRVhUCiAjaWZkZWYgV0lSRUxFU1NfU1BZCi0gICAgICAgICAgICAgICAgICAgIGlmKCBscC0+c3B5ZGF0YS5zcHlfbnVtYmVyID4gMCApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKnNyY2FkZHIgPSBza2ItPm1hYy5yYXcgKyBNQUNfQUREUl9TSVpFOworCQkJCQlpZiAobHAtPnNweWRhdGEuc3B5X251bWJlciA+IDApIHsKKwkJCQkJCWNoYXIgKnNyY2FkZHIgPQorCQkJCQkJICAgIHNrYi0+bWFjLnJhdyArCisJCQkJCQkgICAgTUFDX0FERFJfU0laRTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgd2xfc3B5X2dhdGhlciggZGV2LCBzcmNhZGRyICk7Ci0gICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJCXdsX3NweV9nYXRoZXIoZGV2LCBzcmNhZGRyKTsKKwkJCQkJfQogI2VuZGlmIC8qIFdJUkVMRVNTX1NQWSAqLwogI2VuZGlmIC8qIFdJUkVMRVNTX0VYVCAqLwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIgKTsKKwkJCQl9IGVsc2UgeworCQkJCQlEQkdfRVJST1IoRGJnSW5mbywKKwkJCQkJCSAgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfZHJvcHBlZCsrOwotICAgICAgICAgICAgICAgICAgICB9CisJCQkJCWlmIChwb3J0ID09IDApCisJCQkJCQlscC0+c3RhdHMucnhfZHJvcHBlZCsrOwogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLworCQkJCQllbHNlIHsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X2Ryb3BwZWQrKzsKKwkJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiKCBza2IgKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIkNvdWxkIG5vdCBhbGxvYyBza2JcbiIgKTsKKwkJCQkJZGV2X2tmcmVlX3NrYihza2IpOworCQkJCX0KKwkJCX0gZWxzZSB7CisJCQkJREJHX0VSUk9SKERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWlmIChwb3J0ID09IDApCisJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICB9Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KKwkJCQllbHNlIHsKKwkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJICAgICAxXS5zdGF0cy5yeF9kcm9wcGVkKys7CisJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KKwkJCX0KKwkJfQorCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeAorCXJldHVybiAwOworfQkJCQkvKiB3bF9yeCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpA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RlbnRpdHkuY29tcF9pZCApID09IENPTVBfSURfRldfU1RBICApIHsKLSAgICAgICAgICAgIGlmKCBkZXYtPmZsYWdzICYgSUZGX1BST01JU0MgKSB7Ci0gICAgICAgICAgICAgICAgLyogRW5hYmxlIHByb21pc2N1b3VzIG1vZGUgKi8KLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLmxlbiAgICAgICA9IDI7Ci0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC50eXAgICAgICAgPSBDRkdfUFJPTUlTQ1VPVVNfTU9ERTsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAxICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgUHJvbWlzY3VvdXMgbW9kZSAoSUZGX1BST01JU0MpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICgobmV0ZGV2X21jX2NvdW50KGRldikgPiBIQ0ZfTUFYX01VTFRJQ0FTVCkgfHwKLSAgICAgICAgICAgICAgICAgICAgKCBkZXYtPmZsYWdzICYgSUZGX0FMTE1VTFRJICkpIHsKLSAgICAgICAgICAgICAgICAvKiBTaHV0dGluZyBvZmYgdGhpcyBmaWx0ZXIgd2lsbCBlbmFibGUgYWxsIG11bHRpY2FzdCBmcmFtZXMgdG8KLSAgICAgICAgICAgICAgICAgICBiZSBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsIHNvCi0gICAgICAgICAgICAgICAgICAgYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAwICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgYWxsIG11bHRpY2FzdCBtb2RlIChJRkZfQUxMTVVMVEkpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICAgICAgd2xfYXBwbHkoIGxwICk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICghbmV0ZGV2X21jX2VtcHR5KGRldikpIHsKLSAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIG11bHRpY2FzdCBhZGRyZXNzZXMgKi8KLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLmxlbiA9ICggbmV0ZGV2X21jX2NvdW50KGRldikgKiAzICkgKyAxOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwID0gQ0ZHX0dST1VQX0FERFI7CisJCWlmIChDTlZfSU5UX1RPX0xJVFRMRShscC0+aGNmQ3R4LklGQl9GV0lkZW50aXR5LmNvbXBfaWQpID09CisJCSAgICBDT01QX0lEX0ZXX1NUQSkgeworCQkJaWYgKGRldi0+ZmxhZ3MgJiBJRkZfUFJPTUlTQykgeworCQkJCS8qIEVuYWJsZSBwcm9taXNjdW91cyBtb2RlICovCisJCQkJbHAtPmx0dlJlY29yZC5sZW4gPSAyOworCQkJCWxwLT5sdHZSZWNvcmQudHlwID0gQ0ZHX1BST01JU0NVT1VTX01PREU7CisJCQkJbHAtPmx0dlJlY29yZC51LnUxNlswXSA9IENOVl9JTlRfVE9fTElUVExFK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kJCQkgICAgKG5ldGRldl9tY19jb3VudChkZXYpICogMykgKyAxOworCQkJCWxwLT5sdHZSZWNvcmQudHlwID0gQ0ZHX0dST1VQX0FERFI7CiAKLQkJeCA9IDA7Ci0JCW5ldGRldl9mb3JfZWFjaF9tY19hZGRyKGhhLCBkZXYpCi0gICAgICAgICAgICAgICAgICAgIG1lbWNweSgmKGxwLT5sdHZSZWNvcmQudS51OFt4KysgKiBFVEhfQUxFTl0pLAotCQkJICAgaGEtPmFkZHIsIEVUSF9BTEVOKTsKLSAgICAgICAgICAgICAgICBEQkdfUFJJTlQoICJTZXR0aW5nIG11bHRpY2FzdCBsaXN0XG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8qIERpc2FibGUgcHJvbWlzY3VvdXMgbW9kZSAqLwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQubGVuICAgICAgID0gMjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnR5cCAgICAgICA9IENGR19QUk9NSVNDVU9VU19NT0RFOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudS51MTZbMF0gID0gQ05WX0lOVF9UT19MSVRUTEUoIDAgKTsKLSAgICAgICAgICAgICAgICBEQkdfUFJJTlQoICJEaXNhYmxpbmcgUHJvbWlzY3VvdXMgbW9kZVxuIiApOwotICAgICAgICAgICAgICAgIGhjZl9wdXRfaW5mbyggJiggbHAtPmhjZkN0eCApLCAoTFRWUCkmKCBscC0+bHR2UmVjb3JkICkpOworCQkJCXggPSAwOworCQkJCW5ldGRldl9mb3JfZWFjaF9tY19hZGRyKGhhLCBkZXYpCisJCQkJICAgIG1lbWNweSgmCisJCQkJCSAgIChscC0+bHR2UmVjb3JkLnUudThbeCsrICogRVRIX0FMRU5dKSw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FibGluZyBNdWx0aWNhc3QgbW9kZVxuIik7CisJCQkJaGNmX3B1dF9pbmZvKCYobHAtPmhjZkN0eCksCisJCQkJCSAgICAgKExUVlApICYgKGxwLT5sdHZSZWNvcmQpKTsKIAotICAgICAgICAgICAgICAgIC8qIFR1cm5pbmcgb24gdGhpcyBmaWx0ZXIgd2lsbCBwcmV2ZW50IGFsbCBtdWx0aWNhc3QgZnJhbWVzIGZyb20KLSAgICAgICAgICAgICAgICAgICBiZWluZyBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsCi0gICAgICAgICAgICAgICAgICAgc28gYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAxICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRGlzYWJsaW5nIGFsbCBtdWx0aWNhc3QgbW9kZSAoSUZGX0FMTE1VTFRJKVxuIiApOwotICAgICAgICAgICAgICAgIGhjZl9wdXRfaW5mbyggJiggbHAtPmhjZkN0eCApLCAoTFRWUCkmKCBscC0+bHR2UmVjb3JkICkpOwotICAgICAgICAgICAgICAgIHdsX2FwcGx5KCBscCApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHdsX2FjdF9pbnRfb24oIGxwICk7Ci0Jd2xfdW5sb2NrKCBscCwgJmZsYWdzICk7Ci0gICAgfQorCQkJCS8qCisJCQkJICogVHVybmluZyBvbiB0aGlzIGZpbHRlciB3aWxsIHByZXZlbnQgYWxsIG11bHRpY2FzdCBmcmFtZXMgZn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Lm5kb19zZXRfY29uZmlnID0gJndsX2NvbmZpZywKKwkubmRvX2dldF9zdGF0cyA9ICZ3bF9zdGF0cywKKwkubmRvX3NldF9yeF9tb2RlID0gJndsX211bHRpY2FzdCwKIAotICAgIC5uZG9faW5pdCAgICAgICAgICAgICAgID0gJndsX2luc2VydCwKLSAgICAubmRvX29wZW4gICAgICAgICAgICAgICA9ICZ3bF9hZGFwdGVyX29wZW4sCi0gICAgLm5kb19zdG9wICAgICAgICAgICAgICAgPSAmd2xfYWRhcHRlcl9jbG9zZSwKLSAgICAubmRvX2RvX2lvY3RsICAgICAgICAgICA9ICZ3bF9pb2N0bCwKKwkubmRvX2luaXQgPSAmd2xfaW5zZXJ0LAorCS5uZG9fb3BlbiA9ICZ3bF9hZGFwdGVyX29wZW4sCisJLm5kb19zdG9wID0gJndsX2FkYXB0ZXJfY2xvc2UsCisJLm5kb19kb19pb2N0bCA9ICZ3bF9pb2N0bCwKIAotICAgIC5uZG9fdHhfdGltZW91dCAgICAgICAgID0gJndsX3R4X3RpbWVvdXQsCisJLm5kb190eF90aW1lb3V0ID0gJndsX3R4X3RpbWVvdXQsCiAKICNpZmRlZiBDT05GSUdfTkVUX1BPTExfQ09OVFJPTExFUgotICAgIC5uZG9fcG9sbF9jb250cm9sbGVyICAgID0gd2xfcG9sbCwKKwkubmRvX3BvbGxfY29udHJvbGxlciA9IHdsX3BvbGwsCiAjZW5kaWYKIH07CiAKQEAgLTExNDQsNDggKzExNDgsNTEgQEAKICAqICAgICAgZGV2aWNlLgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgbmV0X2RldmljZSAqIHdsX2RldmljZV9hbGxvYyggdm9pZCApCitzdHJ1Y3QgbmV0X2RldmljZSAqd2xfZGV2aWNlX2FsbG9jKHZvaWQpCiB7Ci0gICAgc3RydWN0IG5ldF9kZXZpY2UgICAqZGV2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7CisJZGV2LT53YXRjaGRvZ190aW1lbyA9IFRYX1RJTUVPVVQ7CiAKLSAgICBkZXYtPndhdGNoZG9nX3RpbWVvICAgICA9IFRYX1RJTUVPVVQ7CisJZGV2LT5ldGh0b29sX29wcyA9ICZ3bF9ldGh0b29sX29wczsKIAotICAgIGRldi0+ZXRodG9vbF9vcHMJICAgID0gJndsX2V0aHRvb2xfb3BzOworCW5ldGlmX3N0b3BfcXVldWUoZGV2KTsKIAotICAgIG5ldGlmX3N0b3BfcXVldWUoIGRldiApOworCS8qIEFsbG9jYXRlIHZpcnR1YWwgZGV2aWNlcyBmb3IgV0RTIHN1cHBvcnQgaWYgbmVlZGVkICovCisJV0xfV0RTX0RFVklDRV9BTExPQyhscCk7CiAKLSAgICAvKiBBbGxvY2F0ZSB2aXJ0dWFsIGRldmljZXMgZm9yIFdEUyBzdXBwb3J0IGlmIG5lZWRlZCAqLwotICAgIFdMX1dEU19ERVZJQ0VfQUxMT0MoIGxwICk7CisJcmV0dXJuIGRldjsKK30JCQkJLyogd2xfZGV2aWNlX2FsbG9jICovCiAKLSAgICByZXR1cm4gZGV2OwotfSAvLyB3bF9kZXZpY2VfYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjA2LDE1ICsxMjEzLDE0IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2RldmljZV9kZWFsbG9jKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK3ZvaWQgd2xfZGV2aWNlX2RlYWxsb2Moc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLS8vICAgIHN0cnVjdCB3bF9wcml2YXRlICAgKmxwID0gd2xfcHJpdihkZXYpOworCS8qIERlYWxsb2MgdGhlIFdEUyBwb3J0cyAqLworCVdMX1dEU19ERVZJQ0VfREVBTExPQyhscCk7CiAKLSAgICAvKiBEZWFsbG9jIHRoZSBXRFMgcG9ydHMgKi8KLSAgICBXTF9XRFNfREVWSUNFX0RFQUxMT0MoIGxwICk7CisJZnJlZV9uZXRkZXYoZGV2KTsKK30JCQkJLyogd2xfZGV2aWNlX2RlYWxsb2MgKi8KIAotICAgIGZyZWVfbmV0ZGV2KCBkZXYgKTsKLX0gLy8gd2xfZGV2aWNlX2RlYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjM1LDE1ICsxMjQxLDE2IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDAoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQwKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAwXG4iICk7CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDBcbiIpOwogCi0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMCApOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjaWZkZWYgRU5BQkxFX0RNQQotICAgIHJldHVybiB3bF90eF9kbWEoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8wICk7CisJcmV0dXJuIHdsX3R4X2RtYShza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjZW5kaWYKLX0gLy8gd2xfdHhfcG9ydDAKK30JCQkJLyogd2xfdHhfcG9ydDBpICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKICNpZmRlZiBVU0VfV0RTCkBAIC0xMjY2LDExICsxMjczLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDEoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQxKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMSApOwotfSAvLyB3bF90eF9wb3J0MQorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzEpOworfQkJCQkvKiB3bF90eF9wb3J0MSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTI5MSwxMSArMTI5OSwxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQyKCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0MihzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzIgKTsKLX0gLy8gd2xfdHhfcG9ydDIKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF8yKTsKK30JCQkJLyogd2xfdHhfcG9ydDIgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzMTYsMTEgKzEzMjUsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Myggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDMoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8zICk7Ci19IC8vIHdsX3R4X3BvcnQzCisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMyk7Cit9CQkJCS8qIHdsX3R4X3BvcnQzICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMzQxLDExICsxMzUxLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDQoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQ0KHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfNCApOwotfSAvLyB3bF90eF9wb3J0NAorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzQpOworfQkJCQkvKiB3bF90eF9wb3J0NCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTM2NiwxMSArMTM3NywxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQ1KCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0NShzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzUgKTsKLX0gLy8gd2xfdHhfcG9ydDUKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF81KTsKK30JCQkJLyogd2xfdHhfcG9ydDUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzOTEsMTEgKzE0MDMsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Niggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDYoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF82ICk7Ci19IC8vIHdsX3R4X3BvcnQ2CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfNik7Cit9CQkJCS8qIHdsX3R4X3BvcnQ2ICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDE3LDUwICsxNDMwLDUyIEBACiAgKiAgICAgIHN0cnVjdHMgaW4gdGhlIHByaXZhdGUgYWRhcHRlciBzdHJ1Y3R1cmUuCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfd2RzX2RldmljZV9hbGxvYyggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX2RldmljZV9hbGxvYyhzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7Ci0gICAgaW50IGNvdW50OworCWludCBjb3VudDsKIAotICAgIC8qIFdEUyBzdXBwb3J0IHJlcXVpcmVzIGFkZGl0aW9uYWwgbmV0X2RldmljZSBzdHJ1Y3RzIHRvIGJlIGFsbG9jYXRlZCwKLSAgICAgICBzbyB0aGF0IHVzZXIgc3BhY2UgYXBwcyBjYW4gdXNlIHRoZXNlIHZ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G9jICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDgwLDI2ICsxNDk1LDI3IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19kZXZpY2VfZGVhbGxvYyggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX2RldmljZV9kZWFsbG9jKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogCi0gICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1JUUzsgY291bnQrKyApIHsKLSAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldl93ZHMgPSBOVUxMOworCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJc3RydWN0IG5ldF9kZXZpY2UgKmRldl93ZHMgPSBOVUxMOwogCi0gICAgICAgIGRldl93ZHMgPSBscC0+d2RzX3BvcnRbY291bnRdLmRldjsKKwkJZGV2X3dkcyA9IGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2OwogCi0gICAgICAgIGlmKCBkZXZfd2RzICE9IE5VTEwgKSB7Ci0gICAgICAgICAgICBpZiggZGV2X3dkcy0+ZmxhZ3MgJiBJRkZfVVAgKSB7Ci0gICAgICAgICAgICAgICAgZGV2X2Nsb3NlKCBkZXZfd2RzICk7Ci0gICAgICAgICAgICAgICAgZGV2X3dkcy0+ZmxhZ3MgJj0gfiggSUZGX1VQIHwgSUZGX1JVTk5JTkcgKTsKLSAgICAgICAgICAgIH0KKwkJaWYgKGRldl93ZHMgIT0gTlVMTCkgeworCQkJaWYgKGRldl93ZHMtPmZsYWdzICYgSUZGX1VQKSB7CisJCQkJZGV2X2Nsb3NlKGRldl93ZHMpOworCQkJCWRldl93ZHMtPmZsYWdzICY9IH4oSUZGX1VQIHwgSUZGX1JVTk5JTkcpOworCQkJfQogCi0gICAgICAgICAgICBmcmVlX25ldGRldihkZXZfd2RzKTsKLSAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ID0gTlVMTDsKLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX2RldmljZV9kZWFsbG9jCisJCQlmcmVlX25ldGRldihkZXZfd2RzKTsKKwkJCWxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ID0gTlVMTDsKKwkJfQorCX0KK30JCQkJLyogd2xfd2RzX2RldmljZV9kZWFsbG9jICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNTIwLDIxICsxNTM2LDIyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3N0YXJ0X3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gRkFMU0UgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfc3RhcnRfcXVldWUoIGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ICk7Ci0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19IC8vIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfc3RhcnRfcXVldWUobHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQkJCWxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RhcnRfcXVldWUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTE1NTUsMjEgKzE1NzIsMjIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfd2RzX25ldGlmX3N0b3BfcXVldWUoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9zdG9wX3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gVFJVRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBGQUxTRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX3N0b3BfcXVldWUKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCisJCQkgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBUUlVFKSB7CisJCQkJbmV0aWZfc3RvcF9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IEZBTFNFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RvcF9xdWV1ZSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTU5MCwyMSArMTYwOCwyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3dha2VfcXVldWUoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewotICAgIGludCBjb3VudDsKKwlpbnQgY291bnQ7CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0gICAgaWYoIGxwICE9IE5VTEwgKSB7Ci0gICAgICAgIGZvciggY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KysgKSB7Ci0gICAgICAgICAgICBpZiggbHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCi0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBGQUxTRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfSAvLyB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfd2FrZV9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7CisJCQl9CisJCX0KKwl9Cit9CQkJCS8qIHdsX3dkc19uZXRpZl93YWtlX3F1ZXVlICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNjI1LDE5ICsxNjQ0LDE5IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29uKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQordm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7Ci0gICAgaW50IGNvdW50OworCWludCBjb3VudDsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBpZiggbHAgIT0gTlVMTCApIHsKLSAgICAgICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1JUUzsgY291bnQrKyApIHsKLSAgICAgICAgICAgIGlmKCBscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vbiggbHAtPndkc19wb3J0W2NvdW50XS5kZXYgKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX2NhcnJpZXJfb24KKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQorCQkJCW5ldGlmX2NhcnJpZXJfb24obHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbiAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTY1OCwyMSArMTY3NywyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29mZihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7CiAJaW50IGNvdW50OwogCi0JaWYobHAgIT0gTlVMTCkgewotCQlmb3IoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKLQkJCWlmKGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCkKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQogCQkJCW5ldGlmX2NhcnJpZXJfb2ZmKGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2KTsKIAkJfQogCX0KIAotfSAvLyB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYKK30JCQkJLyogd2xfd2RzX25ldGlmX2NhcnJpZXJfb2ZmICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKLSNlbmRpZiAgLyogVVNFX1dEUyAqLworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAogI2lmZGVmIEVOQUJMRV9ETUEKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xN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CQkJCS8qIHdsX3NlbmRfZG1hICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNzc5LDE0NyArMTgwMCwxNTIgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfcnhfZG1hKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF9yeF9kbWEoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBoY2ZfMTYgICAgICAgICAgICAgICAgICAgcGt0bGVuOwotICAgIGhjZl8xNiAgICAgICAgICAgICAgICAgICBoZnNfc3RhdDsKLSAgICBzdHJ1Y3Qgc2tfYnVmZiAgICAgICAgICAqc2tiOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICpscCA9IE5VTEw7Ci0gICAgREVTQ19TVFJDVCAgICAgICAgICAgICAgKmRlc2MsICpkZXNjX25leHQ7Ci0gICAgLy9DRkdfTUJfSU5GT19SQU5HRTJfU1RSQ1QgeDsKKwlpbnQgcG9ydDsKKwloY2ZfMTYgcGt0bGVuOworCWhjZl8xNiBoZnNfc3RhdDsKKwlzdHJ1Y3Qgc2tfYnVmZiAqc2tiOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IE5VTEw7CisJREVTQ19TVFJDVCAqZGVzYywgKmRlc2NfbmV4dDsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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0YgKi8KKwkJCQloY2ZfZG1hX3J4X3B1dCgmKGxwLT5oY2ZDdHgpLCBkZXNjKTsKKwkJCQlyZXR1cm4gLUVJTzsKKwkJCX0KIAotICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB3aGF0IHBvcnQgdGhpcyBwYWNrZXQgaXMgZm9yICovCi0gICAgICAgICAgICAgICAgcG9ydCA9ICggaGZzX3N0YXQgPj4gOCApICYgMHgwMDA3OwotICAgICAgICAgICAgICAgIERCR19SWCggRGJnSW5mbywgIlJ4IGZyYW1lIGZvciBwb3J0ICVkXG4iLCBwb3J0ICk7CisJCQkvKiBEZXRlcm1pbmUgd2hhdCBwb3J0IHRoaXMgcGFja2V0IGlzIGZvciAqLworCQkJcG9ydCA9IChoZnNfc3RhdCA+PiA4KSAmIDB4MDAwNzsKKwkJCURCR19SWChEYmdJbmZvLCAiUnggZnJhbWUgZm9yIHBvcnQgJWRcbiIsIHBvcnQpOwogCi0gICAgICAgICAgICAgICAgcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKLSAgICAgICAgICAgICAgICBpZiAocGt0bGVuICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChza2IgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKCBwb3J0ICkgeworCQkJcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKKwkJCWlmIChwa3RsZW4gIT0gMCkgeworCQkJCXNrYiA9IEFMTE9DX1NLQihwa3RsZW4pOworCQkJCWlmIChza2IgIT0gTlVMTCkgeworCQkJCQlzd2l0Y2ggKHBvcnQpIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KKwkJCQkJY2FzZSAxOgorCQkJCQljYXNlIDI6CisJCQkJCWNhc2UgMzoKKwkJCQkJY2FzZSA0OgorCQkJCQljYXNlIDU6CisJCQkJCWNhc2UgNjoKKwkJCQkJCXNrYi0+ZGV2ID0KKwkJCQkJCSAgICBscC0+d2RzX3BvcnRbcG9ydCAtIDFdLmRldjsKKwkJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJY2FzZSAwOgorCQkJCQlkZWZhdWx0OgorCQkJCQkJc2tiLT5kZXYgPSBkZXY7CisJCQkJCQlicmVhazsKKwkJCQkJfQogCi0gICAgICAgICAgICAgICAgICAgICAgICBHRVRfUEFDS0VUX0RNQSggc2tiLT5kZXYsIHNrYiwgcGt0bGVuICk7CisJCQkJCUdFVF9QQUNLRVRfRE1BKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCi0gICAgICAgICAgICAgICAgICAgICAgICBoY2ZfZG1hX3J4X3B1dCggJiggbHAtPmhjZkN0eCApLCBkZXNjICk7CisJCQkJCS8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCisJCQkJCWhjZl9kbWFfcnhfcHV0KCYobHAtPmhjZkN0eCksIGRlc2MpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJCW5ldGlmX3J4KHNrYik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X3BhY2tldHMrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W3BvcnQtMV0uc3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfcGFja2V0cysrOworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfYnl0ZXMgKz0gcGt0bGVuOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLwogCi0gICAgICAgICAgICAgICAgICAgICAgICBkZXYtPmxhc3RfcnggPSBqaWZmaWVzOworCQkJCQlkZXYtPmxhc3RfcnggPSBqaWZmaWVzOwogCi0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQkdfRVJST1IoIERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iICk7CisJCQkJfSBlbHNlIHsKKwkJCQkJREJHX0VSUk9SKERiZ0luZm8sCisJCQkJCQkgICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBvcnQgPT0gMCApCi0JICAgICAgICAgICAgICAgICAgICB7Ci0JICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLQkgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJaWYgKHBvcnQgPT0gMCkKKwkJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAvL30KLSAgICB9CisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfZHJvcHBlZCsrOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLworCQkJCX0KKwkJCX0KKwkJfQorCQkvKn0qLworCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeF9kbWEKKwlyZXR1cm4gMDsKK30JCQkJLyogd2xfcnhfZG1hICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0jZW5kaWYgIC8vIEVOQUJMRV9ETUEKKyNlbmRpZiAvKiBFTkFCTEVfRE1BICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMgYi9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMKaW5kZXggNGNhNmU0Mi4uNzUwMTljMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfdXRpbC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL3dsX3V0aWwuYwpAQCAtMTYxLDQzICsxNjEsNiBAQAogCiAKIAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoJcGVyY2VudCgpCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqICBERVNDUklQVElPTjoKLSAqCi0gKiAgICAgIFJldHVybiBhIHZhbHVlIGFzIGEgcGVyY2VudGFnZSBvZiBtaW4gdG8gbWF4LgotICoKLSAqICBQQVJBTUVURVJTOgotICoKLSAqICAgICAgdmFsdWUgICAtIHRoZSB2YWx1ZSBpbiBxdWVzdGlvbgotICogICAgICBtaW4gICAgIC0gdGhlIG1pbmltdW0gcmFuZ2UgdmFsdWUKLSAqICAgICAgbWF4ICAgICAtIHRoZSBtYXhpbXVtIHJhbmdlIHZhbHVlCi0gKgotICogIFJFVFVSTlM6Ci0gKgotICogICAgICB0aGUgcGVyY2VudGFnZSB2YWx1ZQotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgcGVyY2VudCggaW50IHZhbHVlLCBpbnQgbWluLCBpbnQgbWF4ICkKLXsKLSAgICAvKiBUcnVuY2F0ZSB0aGUgdmFsdWUgdG8gYmUgYmV0d2VlbiBtaW4gYW5kIG1heC4gKi8KLSAgICBpZiggdmFsdWUgPCBtaW4gKQotICAgICAgICB2YWx1ZSA9IG1pbjsKLQotICAgIGlmKCB2YWx1ZSA+IG1heCApCi0gICAgICAgIHZhbHVlID0gbWF4OwotCi0gICAgLyogUmV0dXJuIHRoZSB2YWx1ZSBhcyBhIHBlcmNlbnRhZ2Ugb2YgbWluIHRvIG1heC4gKi8KLSAgICByZXR1cm4gKCgoIHZhbHVlIC0gbWluICkgKiAxMDAgKSAvICggbWF4IC0gbWluICkpOwotfSAvLyBwZXJjZW50Ci0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0KLQotCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoJaXNfdmFsaWRfa2V5X3N0cmluZygpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd2V4dC5jIGIvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd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MDY0NAotLS0gYS9pbmNsdWRlL2xpbnV4L21mZC9hcml6b25hL3JlZ2lzdGVycy5oCisrKyBiL2luY2x1ZGUvbGludXgvbWZkL2FyaXpvbmEvcmVnaXN0ZXJzLmgKQEAgLTE3MDIsOSArMTcwMiw5IEBACiAvKgogICogUjM3MyAoMHgxNzUpIC0gRkxMMSBDb250cm9sIDUKICAqLwotI2RlZmluZSBBUklaT05BX0ZMTDFfRlJBVElPX01BU0sgICAgICAgICAgICAgICAgIDB4MDcwMCAgLyogRkxMMV9GUkFUSU8gLSBbMTA6OF0gKi8KLSNkZWZpbmUgQVJJWk9OQV9GTEwxX0ZSQVRJT19TSElGVCAgICAgICAgICAgICAgICAgICAgIDggIC8qIEZMTDFfRlJBVElPIC0gWzEwOjhdICovCi0jZGVmaW5lIEFSSVpPTkFfRkxMMV9GUkFUSU9fV0lEVEggICAgICAgICAgICAgICAgICAgICAzICAvKiBGTEwxX0ZSQVRJTyAtIFsxMDo4XSAqLworI2RlZmluZSBBUklaT05BX0ZMTDFfRlJBVElPX01BU0sgICAgICAgICAgICAgICAgIDB4MEYwMCAgLyogRkxMMV9GUkFUSU8gLSBbMTE6OF0gKi8KKyNkZWZpbmUgQVJJWk9OQV9GTEwxX0ZSQVRJT19TSElGVCAgICAgICAgICAgICAgICAgICAgIDggIC8qIEZMTDFfRlJBVElPIC0gWzExOjhdICovCisjZGVmaW5lIEFSSVpPTkFfRkxMMV9GUkFUSU9fV0lEVEggICAgICAgICAgICAgICAgICAgICA0ICAvKiBGTEwxX0ZSQVRJTyAtIFsxMTo4XSAqLwogI2RlZmluZSBBUklaT05BX0ZMTDFfT1VURElWX01BU0sgICAgICAgICAgICAgICAgIDB4MDAwRSAgLyogRkxMMV9PVVRESVYgLSBbMzoxXSAqLwogI2RlZmluZSBBUklaT05BX0ZMTDFfT1VURElWX1NISUZUICAgICAgICAgICAgICAgICAgICAgMSAgLyogRkxMMV9PVVRESVYgLSBbMzoxXSAqLwogI2RlZmluZSBBUkl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pbnQgb2Zmc2V0LCB1bnNpZ25lZCBpbnQgdmFsKSwKKworCVRQX0FSR1Mob2Zmc2V0LCB2YWwpCisKKyk7CisKK0RFRklORV9FVkVOVChzc3RfaXBjX21haWxib3gsIHNzdF9pcGNfb3V0Ym94X3JkYXRhLAorCisJVFBfUFJPVE8odW5zaWduZWQgaW50IG9mZnNldCwgdW5zaWduZWQgaW50IHZhbCksCisKKwlUUF9BUkdTKG9mZnNldCwgdmFsKQorCispOworCitERUZJTkVfRVZFTlQoc3N0X2lwY19tYWlsYm94LCBzc3RfaXBjX291dGJveF93ZGF0YSwKKworCVRQX1BST1RPKHVuc2lnbmVkIGludCBvZmZzZXQsIHVuc2lnbmVkIGludCB2YWwpLAorCisJVFBfQVJHUyhvZmZzZXQsIHZhbCkKKworKTsKKworREVDTEFSRV9FVkVOVF9DTEFTUyhzc3RfaXBjX21haWxib3hfaW5mbywKKworCVRQX1BST1RPKHVuc2lnbmVkIGludCBzaXplKSwKKworCVRQX0FSR1Moc2l6ZSksCisKKwlUUF9TVFJVQ1RfX2VudHJ5KAorCQlfX2ZpZWxkKAl1bnNpZ25lZCBpbnQsCXNpemUJCSkKKwkpLAorCisJVFBfZmFzdF9hc3NpZ24oCisJCV9fZW50cnktPnNpemUgPSBzaXplOworCSksCisKKwlUUF9wcmludGsoIk1haWxib3ggYnl0ZXMgMHglOC44eCIsICh1bnNpZ25lZCBpbnQpX19lbnRyeS0+c2l6ZSkKKyk7CisKK0RFRklORV9FVkVOVChzc3RfaXBjX21haWxib3hfaW5mbywgc3N0X2lwY19pbmJveF9yZWFkLAorCisJVFBfUFJPVE8odW5zaWduZWQgaW50IHNpemUpLAorCisJVFBfQVJHUyhzaXplKQorCispOworCitERUZJTkVfRVZFTlQoc3N0X2lwY19tYWlsYm94X2luZm8sIHNzdF9pcGNfaW5ib3hfd3JpdGUsCisKKwlUUF9QUk9UTyh1bnNpZ25lZCBpbnQgc2l6ZSksCisKKwlUUF9BUkdTKHNpemUpCisKKyk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X3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMDY3LCAgIDEwMjQsICAgICAgICAgICAxMDY3LCAgICAgICAgICAgMTAyNywgICAgICAgICAgIDEwMzAsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA0LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xNjAwXzEwMjRfNjAsCi0gICAgLyogZmxhZ3MsCQkJCQl3aWR0aCwgICAgICAgICAgaGVpZ2h0LAkJCWZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIERCRV9WT0ZfRkxBVFBBTkVMLCAgIDE2MDAsICAgICAgICAgICAxMDI0LAkJCTYwMDAwLCAgICAgICAgICAxMDY5MTMsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAxNjcwLCAgIDE2MDAsICAgICAgICAgICAxNjcwLCAgICAgICAgICAgMTYzMCwgICAgICAgICAgIDE2NTAsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMDY3LCAgIDEwMjQsICAgICAgICAgICAxMDY3LCAgICAgICAgICAgMTAyNywgICAgICAgICAgIDEwMzAsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA0LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xNjAwXzEyMDBfNTAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTYwMCwgICAgICAgICAgIDEyMDAsICAgICAgICAgICA1MDAwMCwgICAgICAgICAgMTMwNTAwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjA4OCwgICAxNjAwLCAgICAgICAgICAgMjA4OCwgICAgICAgICAgIDE2NDQsICAgICAgICAgICAxNzY0LAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTI1MCwgICAxMjAwLCAgICAgICAgICAgMTI1MCwgICAgICAgICAgIDEyMDUsICAgICAgICAgICAxMjExLAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgMjQsICAgICA1LCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTYwMF8xMjAwXzYwLAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE2MDAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNTk5NDAsICAgICAgICAgIDE2MjAwMCwKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDIxNjAsICAgMTYwMCwgICAgICAgICAgIDIxNjAsICAgICAgICAgICAxNjQ0LCAgICAgICAgICAgMTg1NiwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDEyNTAsICAgMTIwMCwgICAgICAgICAgIDEyNTAsICAgICAgICAgICAxMjAxLCAgICAgICAgICAgMTIwNCwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDYsCQkxLCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTYwMF8xMjAwXzc1LAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE2MDAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNzUwMDAsICAgICAgICAgIDIwMjUwMCwKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDIxNjAsICAgMTYwMCwgICAgICAgICAgIDIxNjAsICAgICAgICAgICAxNjQ0LCAgICAgICAgICAgMTg1NiwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDEyNTAsICAgMTIwMCwgICAgICAgICAgIDEyNTAsICAgICAgICAgICAxMjAxLCAgICAgICAgICAgMTIwNCwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDE1LAkJMiwgICAgICAgICAgICAgIDAKLSAgfSwKLQotICB7Ci0gICAgREJFX1ZUXzE5MjBfMTA4MF81MCwKLSAgICAvKiBmbGFncywgIHdpZHRoLCAgICAgICAgICBoZWlnaHQsICAgICAgICAgZmllbGRzX3NlYywgICAgIGNmcmVxICovCi0gICAgMCwgICAgICAxOTIwLCAgICAgICAgICAgMTA4MCwgICAgICAgICAgIDUwMDAwLCAgICAgICAgICAxMzMyMDAsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAyMzY4LCAgIDE5MjAsICAgICAgICAgICAyMzY4LCAgICAgICAgICAgMTk1MiwgICAgICAgICAgIDIwOTYsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMTI1LCAgIDEwODAsICAgICAgICAgICAxMTI1LCAgICAgICAgICAgMTA4MywgICAgICAgICAgIDEwODYsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA1LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xOTIwXzEwODBfNjAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTkyMCwgICAgICAgICAgIDEwODAsICAgICAgICAgICA1OTk0MCwgICAgICAgICAgMTU5ODQwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjM2OCwgICAxOTIwLCAgICAgICAgICAgMjM2OCwgICAgICAgICAgIDE5NTIsICAgICAgICAgICAyMDk2LAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTEyNSwgICAxMDgwLCAgICAgICAgICAgMTEyNSwgICAgICAgICAgIDEwODMsICAgICAgICAgICAxMDg2LAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgNiwgICAgICAxLCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTkyMF8xMDgwXzcyLAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE5MjAsICAgICAgICAgICAxMDgwLCAgICAgICAgICAgNzIwMDAsICAgICAgICAgIDIxNjAyMywKLSAgICAvKiBodG90YWwsIGhibGFua19zdGFydCwgICBoYmxhbmtfZW5kLCAgICAgaHN5bmNfc3RhcnQsICAgIGhzeW5jX2VuZCAqLwotICAgIDI1NjAsICAgMTkyMCwgICAgICAgICAgIDI1NjAsICAgICAgICAgICAxOTY4LCAgICAgICAgICAgMjE4NCwKLSAgICAvKiB2dG90YWwsIHZibGFua19zdGFydCwgICB2YmxhbmtfZW5kLCAgICAgdnN5bmNfc3RhcnQsICAgIHZzeW5jX2VuZCAqLwotICAgIDExNzIsICAgMTA4MCwgICAgICAgICAgIDExNzIsICAgICAgICAgICAxMDgzLCAgICAgICAgICAgMTA4NiwKLSAgICAvKiBwbGxfbSwgIHBsbF9uLCAgICAgICAgICBwbGxfcCAqLwotICAgIDgsICAgICAgMSwgICAgICAgICAgICAgIDAKLSAgfSwKLQotICB7Ci0gICAgREJFX1ZUXzE5MjBfMTIwMF81MCwKLSAgICAvKiBmbGFncywgIHdpZHRoLCAgICAgICAgICBoZWlnaHQsICAgICAgICAgZmllbGRzX3NlYywgICAgIGNmcmVxICovCi0gICAgMCwgICAgICAxOTIwLCAgICAgICAgICAgMTIwMCwgICAgICAgICAgIDUwMDAwLCAgICAgICAgICAxNjE1MDAsCi0gICAgLyogaHRvdGFsLCBoYmxhbmtfc3RhcnQsICAgaGJsYW5rX2VuZCwgICAgIGhzeW5jX3N0YXJ0LCAgICBoc3luY19lbmQgKi8KLSAgICAyNTg0LCAgIDE5MjAsICAgICAgICAgICAyNTg0LCAgICAgICAgICAgMTk4NCwgICAgICAgICAgIDIyNDAsCi0gICAgLyogdnRvdGFsLCB2Ymxhbmtfc3RhcnQsICAgdmJsYW5rX2VuZCwgICAgIHZzeW5jX3N0YXJ0LCAgICB2c3luY19lbmQgKi8KLSAgICAxMjUwLCAgIDEyMDAsICAgICAgICAgICAxMjUwLCAgICAgICAgICAgMTIwMywgICAgICAgICAgIDEyMDYsCi0gICAgLyogcGxsX20sICBwbGxfbiwgICAgICAgICAgcGxsX3AgKi8KLSAgICA2LCAgICAgIDEsICAgICAgICAgICAgICAwCi0gIH0sCi0KLSAgewotICAgIERCRV9WVF8xOTIwXzEyMDBfNjAsCi0gICAgLyogZmxhZ3MsICB3aWR0aCwgICAgICAgICAgaGVpZ2h0LCAgICAgICAgIGZpZWxkc19zZWMsICAgICBjZnJlcSAqLwotICAgIDAsICAgICAgMTkyMCwgICAgICAgICAgIDEyMDAsICAgICAgICAgICA1OTk0MCwgICAgICAgICAgMTkzODAwLAotICAgIC8qIGh0b3RhbCwgaGJsYW5rX3N0YXJ0LCAgIGhibGFua19lbmQsICAgICBoc3luY19zdGFydCwgICAgaHN5bmNfZW5kICovCi0gICAgMjU4NCwgICAxOTIwLCAgICAgICAgICAgMjU4NCwgICAgICAgICAgIDE5ODQsICAgICAgICAgICAyMjQwLAotICAgIC8qIHZ0b3RhbCwgdmJsYW5rX3N0YXJ0LCAgIHZibGFua19lbmQsICAgICB2c3luY19zdGFydCwgICAgdnN5bmNfZW5kICovCi0gICAgMTI1MCwgICAxMjAwLCAgICAgICAgICAgMTI1MCwgICAgICAgICAgIDEyMDMsICAgICAgICAgICAxMjA2LAotICAgIC8qIHBsbF9tLCAgcGxsX24sICAgICAgICAgIHBsbF9wICovCi0gICAgMjksICAgICA0LCAgICAgICAgICAgICAgMAotICB9LAotCi0gIHsKLSAgICBEQkVfVlRfMTkyMF8xMjAwXzY2LAotICAgIC8qIGZsYWdzLCAgd2lkdGgsICAgICAgICAgIGhlaWdodCwgICAgICAgICBmaWVsZHNfc2VjLCAgICAgY2ZyZXEgKi8KLSAgICAwLCAgICAgIDE5MjAsICAgICAgICAgICAxMjAwLCAgICAgICAgICAgNjYwMDAsICAgICAgICAgIDIx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G4pICAgICAgICAgIChzaHV0X3VwID8gMCA6IERCR0MocnRuKSkKLSNkZWZpbmUgREJHUlYoKSAgICAgICAgICAgICAoc2h1dF91cCA/IDAgOiBEQkdSKCkpCi0KLSNlbHNlIC8qICFWV1NORF9ERUJVRyAqLwotCi0jZGVmaW5lIEFTU0VSVChlKSAgICAgICAgICAgKCh2b2lkKSAwKQotI2RlZmluZSBEQkdETyh4KSAgICAgICAgICAgIC8qIGRvbid0ICovCi0jZGVmaW5lIERCR1goZm10LCBhcmdzLi4uKSAgKCh2b2lkKSAwKQotI2RlZmluZSBEQkdQKGZtdCwgYXJncy4uLikgICgodm9pZCkgMCkKLSNkZWZpbmUgREJHRShmbXQsIGFyZ3MuLi4pICAoKHZvaWQpIDApCi0jZGVmaW5lIERCR0MocnRuKSAgICAgICAgICAgKCh2b2lkKSAwKQotI2RlZmluZSBEQkdSKCkgICAgICAgICAgICAgICgodm9pZCkgMCkKLSNkZWZpbmUgREJHUFYoZm10LCBhcmdzLi4uKSAoKHZvaWQpIDApCi0jZGVmaW5lIERCR1hWKGZtdCwgYXJncy4uLikgKCh2b2lkKSAwKQotI2RlZmluZSBEQkdFVihmbXQsIGFyZ3MuLi4pICgodm9pZCkgMCkKLSNkZWZpbmUgREJHQ1YocnRuKSAgICAgICAgICAoKHZvaWQpIDApCi0jZGVmaW5lIERCR1JWKCkgICAgICAgICAgICAgKCh2b2lkKSAwKQotCi0jZW5kaWYgLyogIVZXU05EX0RFQlVHICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIGxvdyBsZXZlbCBsaXRoaXVtIGFjY2VzcyAqLwotCi0vKgotICogV2UgbmVlZCB0byB0YWxrIHRvIExpdGhpdW0gcmVnaXN0ZXJzIG9uIHRocmVlIHBhZ2VzLiAgSGVyZSBhcmUKLSAqIHRoZSBwYWdlcycgb2Zmc2V0cyBmcm9tIHRoZ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VJOX0RFQlVHCi0JICAgICAgICIgIDB4MDE6IHJpZ2h0IGlucHV0ICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDEpKTsKLQlwcmludGsoIiAgMHgyMTogc3ludGggcmF0ZSBoaWdoID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyMSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDI6IGxlZnQgQVVYMSAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDIpKTsKLQlwcmludGsoIiAgMHgyMjogQURDIGNsb2NrICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyMikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDM6IHJpZ2h0IEFVWDEgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDMpKTsKLQlwcmludGsoIiAgMHgyMzogQURDIGFsdCByYXRlICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyMykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDQ6IGxlZnQgQ0QgICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDQpKTsKLQlwcmludGsoIiAgMHgyNDogQURDIHBsbCBNICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDU6IHJpZ2h0IENEICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDUpKTsKLQlwcmludGsoIiAgMHgyNTogQURDIHBsbCBOICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDY6IGxlZnQgbGluZSAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDYpKTsKLQlwcmludGsoIiAgMHgyNjogU3ludGggcGxsIE0gICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDc6IHJpZ2h0IGxpbmUgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDcpKTsKLQlwcmludGsoIiAgMHgyNzogU3ludGggcGxsIE4gICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDg6IE1JQyAgICAgICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDgpKTsKLQlwcmludGsoIiAgMHgyODogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyOCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MDk6IEdhbWUgcG9ydCAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDkpKTsKLQlwcmludGsoIiAgMHgyOTogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyOSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGE6IGxlZnQgc3ludGggICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGEpKTsKLQlwcmludGsoIiAgMHgyYTogTVBVNDAxICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyYSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGI6IHJpZ2h0IHN5bnRoICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGIpKTsKLQlwcmludGsoIiAgMHgyYjogZHJpdmUgY3RybCAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyYikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGM6IGxlZnQgQVVYMiAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGMpKTsKLQlwcmludGsoIiAgMHgyYzogU1JTIHNwYWNlICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyYykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGQ6IHJpZ2h0IEFVWDIgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGQpKTsKLQlwcmludGsoIiAgMHgyZDogU1JTIGNlbnRlciAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyZCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGU6IGxlZnQgYW5hbG9nICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGUpKTsKLQlwcmludGsoIiAgMHgyZTogd2F2ZSBzb3VyY2UgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyZSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MGY6IHJpZ2h0IGFuYWxvZyAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGYpKTsKLQlwcmludGsoIiAgMHgyZjogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyZikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTA6IGxlZnQgUENNICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTApKTsKLQlwcmludGsoIiAgMHgzMDogYW5hbG9nIHBvd2VyICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzMCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTE6IHJpZ2h0IFBDTSAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTEpKTsKLQlwcmludGsoIiAgMHgzMTogYW5hbG9nIHBvd2VyICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzMSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTI6IERNQSBkYXRhIGZvcm1hdCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTIpKTsKLQlwcmludGsoIiAgMHgzMjogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzMikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTM6IFAvQyBlbmFibGUgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTMpKTsKLQlwcmludGsoIiAgMHgzMzogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzMykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTQ6IFUvRCBidXR0b24gICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTQpKTsKLQlwcmludGsoIiAgMHgzNDogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTU6IHJldmlzaW9uICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTUpKTsKLQlwcmludGsoIiAgMHgzNTogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTY6IEFEQyBvdXRwdXQgY3RybCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTYpKTsKLQlwcmludGsoIiAgMHgzNjogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTc6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTcpKTsKLQlwcmludGsoIiAgMHgzNzogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTg6IERNQSBBIHVwcGVyIGNudCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTgpKTsKLQlwcmludGsoIiAgMHgzODogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzOCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MTk6IERNQSBBIGxvd2VyIGNudCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTkpKTsKLQlwcmludGsoIiAgMHgzOTogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzOSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWE6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWEpKTsKLQlwcmludGsoIiAgMHgzYTogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWI6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWIpKTsKLQlwcmludGsoIiAgMHgzYjogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYikpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWM6IERNQSBDIHVwcGVyIGNudCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWMpKTsKLQlwcmludGsoIiAgMHgzYzogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYykpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWQ6IERNQSBDIHVwcGVyIGNudCA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWQpKTsKLQlwcmludGsoIiAgMHgzZDogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzZCkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWU6IFBDTSByYXRlIGxvdyAgICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWUpKTsKLQlwcmludGsoIiAgMHgzZTogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzZSkpOwotCXByaW50ayhLRVJOX0RFQlVHCi0JICAgICAgICIgIDB4MWY6IFBDTSByYXRlIGhpZ2ggICA9IDB4JTAyeCAgIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWYpKTsKLQlwcmludGsoIiAgMHgzZjogLS0tICAgICAgICAgICAgID0gMHglMDJ4XG4iLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzZikpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIlNWIFJFR1M6ICAgICAgICAgIElOREVYID0gMHglMDJ4ICAgICAgICAgICAgICAgICAgIFNUQVRVUyA9IDB4JTAyeFxuIiwKKwkJaW5iKFNWX1JFRyhzb25pYywgSU5ERVgpKSwgaW5iKFNWX1JFRyhzb25pYywgU1RBVFVTKSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwMDogbGVmdCBpbnB1dCAgICAgID0gMHglMDJ4ICAgIDB4MjA6IHN5bnRoIHJhdGUgbG93ICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDApLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyMCkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwMTogcmlnaHQgaW5wdXQgICAgID0gMHglMDJ4ICAgIDB4MjE6IHN5bnRoIHJhdG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B4MjY6IFN5bnRoIHBsbCBNICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDYpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNikpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwNzogcmlnaHQgbGluZSAgICAgID0gMHglMDJ4ICAgIDB4Mjc6IFN5bnRoIHBsbCBOICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDcpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyNykpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwODogTUlDICAgICAgICAgICAgID0gMHglMDJ4ICAgIDB4Mjg6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDgpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyOCkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwOTogR2FtZSBwb3J0ICAgICAgID0gMHglMDJ4ICAgIDB4Mjk6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MDkpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyOSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwYTogbGVmdCBzeW50aCAgICAgID0gMHglMDJ4ICAgIDB4MmE6IE1QVTQwMSAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MGEpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgyYSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgwYjogcmlnaHQgc3ludGggICAgID0gMHglMD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cmV2aXNpb24gICAgICAgID0gMHglMDJ4ICAgIDB4MzU6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTUpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxNjogQURDIG91dHB1dCBjdHJsID0gMHglMDJ4ICAgIDB4MzY6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTYpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNikpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxNzogLS0tICAgICAgICAgICAgID0gMHglMDJ4ICAgIDB4Mzc6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTcpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzNykpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxODogRE1BIEEgdXBwZXIgY250ID0gMHglMDJ4ICAgIDB4Mzg6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTgpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzOCkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxOTogRE1BIEEgbG93ZXIgY250ID0gMHglMDJ4ICAgIDB4Mzk6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MTkpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzOSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxYTogLS0tICAgICAgICAgICAgID0gMHglMDJ4ICAgIDB4M2E6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWEpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxYjogLS0tICAgICAgICAgICAgID0gMHglMDJ4ICAgIDB4M2I6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWIpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYikpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxYzogRE1BIEMgdXBwZXIgY250ID0gMHglMDJ4ICAgIDB4M2M6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWMpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzYykpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxZDogRE1BIEMgdXBwZXIgY250ID0gMHglMDJ4ICAgIDB4M2Q6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWQpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzZCkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiAgMHgxZTogUENNIHJhdGUgbG93ICAgID0gMHglMDJ4ICAgIDB4M2U6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwKKwkJc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MWUpLCBzbmRfc29uaWN2aWJlc19pbihzb25pYywgMHgzZSkpOworCWRldl9kYmcoc29uaWMtPmNhcmQtPmRldiwKKwkJIiA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NMT1RfT0ZGU0VUCTAKKworc3RydWN0IGFkYXUxOTc3IHsKKwlzdHJ1Y3QgcmVnbWFwICpyZWdtYXA7CisJYm9vbCByaWdodF9qOworCXVuc2lnbmVkIGludCBzeXNjbGs7CisJZW51bSBhZGF1MTk3N19zeXNjbGtfc3JjIHN5c2Nsa19zcmM7CisJc3RydWN0IGdwaW9fZGVzYyAqcmVzZXRfZ3BpbzsKKwllbnVtIGFkYXUxOTc3X3R5cGUgdHlwZTsKKworCXN0cnVjdCByZWd1bGF0b3IgKmF2ZGRfcmVnOworCXN0cnVjdCByZWd1bGF0b3IgKmR2ZGRfcmVnOworCisJc3RydWN0IHNuZF9wY21faHdfY29uc3RyYWludF9saXN0IGNvbnN0cmFpbnRzOworCisJc3RydWN0IGRldmljZSAqZGV2OworCXZvaWQgKCpzd2l0Y2hfbW9kZSkoc3RydWN0IGRldmljZSAqZGV2KTsKKworCXVuc2lnbmVkIGludCBtYXhfbWFzdGVyX2ZzOworCXVuc2lnbmVkIGludCBzbG90X3dpZHRoOworCWJvb2wgZW5hYmxlZDsKKwlib29sIG1hc3RlcjsKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgcmVnX2RlZmF1bHQgYWRhdTE5NzdfcmVnX2RlZmF1bHRzW10gPSB7CisJeyAweDAwLCAweDAwIH0sCisJeyAweDAxLCAweDQxIH0sCisJeyAweDAyLCAweDRhIH0sCisJeyAweDAzLCAweDdkIH0sCisJeyAweDA0LCAweDNkIH0sCisJeyAweDA1LCAweDAyIH0sCisJeyAweDA2LCAweDAwIH0sCisJeyAweDA3LCAweDEwIH0sCisJeyAweDA4LCAweDMyIH0sCisJeyAweDA5LCAweGYwIH0sCisJeyAweDBhLCAweGEwIH0sCisJeyAweDBiLCAweGEwIH0sCisJeyAweDBjLCAweGEwIH0sCisJeyAweDBkLCAweGEwIH0sCisJeyAweDBlLCAweDAyIH0sCisJeyAweDEwLCAweDBmIH0sCisJeyAweDE1LCAweDIwIH0sCisJeyAweDE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c3JjX2luaXQobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF9yYXRlX2dlbjIobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF90aW1pbmdfZ2VuMihtb2QsIHJkYWksIGlvKTsKKwlpZiAocmV0IDwgMCkKKwkJcmV0dXJuIHJldDsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX3N0YXJ0X2dlbjIoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICAgc3RydWN0IHJzbmRfZGFpICpyZGFpLAorCQkJICAgICAgIHN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCXN0cnVjdCByc25kX3NyYyAqc3JjID0gcnNuZF9tb2RfdG9fc3JjKG1vZCk7CisKKwlyc25kX2RtYV9zdGFydChyc25kX21vZF90b19kbWEoJnNyYy0+bW9kKSk7CisKKwlyc25kX21vZF93cml0ZShtb2QsIFNTSV9DVFJMLCAweDEpOworCXJzbmRfbW9kX3dyaXRlKG1vZCwgU1JDX0NUUkwsIDB4MTEpOworCisJcmV0dXJuIHJzbmRfc3JjX3N0YXJ0KG1vZCwgcmRhaSwgaW8pOworfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX3N0b3BfZ2VuMihzdHJ1Y3QgcnNuZF9tb2QgKm1vZCwKKwkJCSAgICAgIHN0cnVjdCByc25kX2RhaSAqcmRhaSwKKwkJCSAgICAgIHN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCXN0cnVjdCByc25kX3NyYyAqc3JjID0gcnNuZF9tb2RfdG9fc3JjKG1vZCk7CisKKwlyc25kX21vZF93cml0ZShtb2QsIFNTSV9DVFJMLCAwKTsKKwlyc25kX21vZF93cml0ZShtb2QsIFNSQ19DVFJMLCAw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7CisKKwlyc25kX29mX3BhcnNlX3NyYyhwZGV2LCBvZl9kYXRhLCBwcml2KTsKKworCS8qCisJICogaW5pdCBTUkMKKwkgKi8KKwlucgk9IGluZm8tPnNyY19pbmZvX25yOworCWlmICghbnIpCisJCXJldHVybiAwOworCisJc3JjCT0gZGV2bV9remFsbG9jKGRldiwgc2l6ZW9mKCpzcmMpICogbnIsIEdGUF9LRVJORUwpOworCWlmICghc3JjKSB7CisJCWRldl9lcnIoZGV2LCAiU1JDIGFsbG9jYXRlIGZhaWxlZFxuIik7CisJCXJldHVybiAtRU5PTUVNOworCX0KKworCXByaXYtPnNyY19ucgk9IG5yOworCXByaXYtPnNyYwk9IHNyYzsKKworCWZvcl9lYWNoX3JzbmRfc3JjKHNyYywgcHJpdiwgaSkgeworCQlzbnByaW50ZihuYW1lLCBSU05EX1NSQ19OQU1FX1NJWkUsICJzcmMuJWQiLCBpKTsKKworCQljbGsgPSBkZXZtX2Nsa19nZXQoZGV2LCBuYW1lKTsKKwkJaWYgKElTX0VSUihjbGspKSB7CisJCQlzbnByaW50ZihuYW1lLCBSU05EX1NSQ19OQU1FX1NJWkUsICJzY3UuJWQiLCBpKTsKKwkJCWNsayA9IGRldm1fY2xrX2dldChkZXYsIG5hbWUpOworCQl9CisKKwkJaWYgKElTX0VSUihjbGspKQorCQkJcmV0dXJuIFBUUl9FUlIoY2xrKTsKKworCQlzcmMtPmluZm8gPSAmaW5mby0+c3JjX2luZm9baV07CisJCXNyYy0+Y2xrID0gY2xrOworCisJCW9wcyA9ICZyc25kX3NyY19ub25fb3BzOworCQlpZiAocnNuZF9zcmNfaHBiaWZfaXNfZW5hYmxlKHNyYykpIHsKKwkJCWlmIChyc25kX2lzX2dlbjEocHJpdikpCisJCQkJb3BzID0gJnJzbmRfc3JjX2dlbjFfb3BzOworCQkJaWYgKHJzbmRfaXNfZ2VuMihwcml2KSkKKwkJCQlvcHMgPSAmcnNuZF9zcmNfZ2VuMl9vcHM7CisJCX0KKworCQlyc25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1cm4gLUVOT0VOVDsKKwllbHNlIGlmIChzdF9mcy5mX3R5cGUgIT0gbWFnaWMpCisJCXJldHVybiAtRU5PRU5UOworCisJcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBib29sIGZzX19jaGVja19tb3VudHMoc3RydWN0IGZzICpmcykKK3sKKwljb25zdCBjaGFyICogY29uc3QgKnB0cjsKKworCXB0ciA9IGZzLT5tb3VudHM7CisJd2hpbGUgKCpwdHIpIHsKKwkJaWYgKGZzX192YWxpZF9tb3VudCgqcHRyLCBmcy0+bWFnaWMpID09IDApIHsKKwkJCWZzLT5mb3VuZCA9IHRydWU7CisJCQlzdHJjcHkoZnMtPnBhdGgsICpwdHIpOworCQkJcmV0dXJuIHRydWU7CisJCX0KKwkJcHRyKys7CisJfQorCisJcmV0dXJuIGZhbHNlOworfQorCitzdGF0aWMgY29uc3QgY2hhciAqZnNfX2dldF9tb3VudHBvaW50KHN0cnVjdCBmcyAqZnMpCit7CisJaWYgKGZzX19jaGVja19tb3VudHMoZnMpKQorCQlyZXR1cm4gZnMtPnBhdGg7CisKKwlyZXR1cm4gZnNfX3JlYWRfbW91bnRzKGZzKSA/IGZzLT5wYXRoIDogTlVMTDsKK30KKworc3RhdGljIGNvbnN0IGNoYXIgKmZzX19tb3VudHBvaW50KGludCBpZHgpCit7CisJc3RydWN0IGZzICpmcyA9ICZmc19fZW50cmllc1tpZHhdOworCisJaWYgKGZzLT5mb3VuZCkKKwkJcmV0dXJuIChjb25zdCBjaGFyICopZnMtPnBhdGg7CisKKwlyZXR1cm4gZnNfX2dldF9tb3VudHBvaW50KGZzKTsKK30KKworI2RlZmluZSBGU19fTU9VTlRQT0lOVChuYW1lLCBpZHgpCVwKK2NvbnN0IGNoYXIgKm5hbWUjI19fbW91bnRwb2ludCh2b2lkKQlcCit7CQkJCQlcCisJcmV0dXJuIGZzX19tb3VudHBvaW50KGlkeCk7CVwKK30KKworRlNfX01PVU5UUE9JTlQoc3lzZnMsICBGU19fU1lTRlMpO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