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CiAgIH0KQEAgLTQ5Miw3ICs0OTAsOCBAQAogICAgICAgICAgIH0KIAogICAgICAgICAgIC8qICgyKSAqLwotICAgICAgICAgIGVyciA9IHNuZF9jYXJkX2NyZWF0ZShpbmRleFtkZXZdLCBpZFtkZXZdLCBUSElTX01PRFVMRSwgMCwgJmNhcmQpOworICAgICAgICAgIGVyciA9IHNuZF9jYXJkX25ldygmcGNpLT5kZXYsIGluZGV4W2Rldl0sIGlkW2Rldl0sIFRISVNfTU9EVUxFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAmY2FyZCk7CiAgICAgICAgICAgaWYgKGVyciA8IDApCiAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwogCkBAIC01OTEsNyArNTkwLDggQEAKICAgc3RydWN0IHNuZF9jYXJkICpjYXJkOwogICBpbnQgZXJyOwogICAuLi4uCi0gIGVyciA9IHNuZF9jYXJkX2NyZWF0ZShpbmRleFtkZXZdLCBpZFtkZXZdLCBUSElTX01PRFVMRSwgMCwgJmNhcmQpOworICBlcnIgPSBzbmRfY2FyZF9uZXcoJnBjaS0+ZGV2LCBpbmRleFtkZXZdLCBpZFtkZXZdLCBUSElTX01PRFVMRSwKKyAgICAgICAgICAgICAgICAgICAgIDAsICZjYXJkKTsKIF1dPgogICAgICAgICAgICAgPC9wcm9ncmFtbGlzdGluZz4KICAgICAgICAgICA8L2luZm9ybWFsZXhhbXBsZT4KQEAgLTgwOSwyOCArODA5LDM0IEBACiAKICAgICAgIDxwYXJhPgogICAgICAgICBBcyBtZW50aW9uZWQgYWJvdmUsIHRvIGNyZWF0ZSBhIGNhcmQgaW5zdGFuY2UsIGNhbGwKLSAgICAgIDxmdW5jdGlvbj5zbmRfY2FyZF9jcmVhdGUoKTwvZnVuY3Rpb24+LgorICAgICAgPGZ1bmN0aW9uPnNuZF9jYXJkX25ldygpPC9mdW5jdGlvbj4uCiAKICAgICAgICAgPGluZm9ybWFsZXhhbXBsZT4KICAgICAgICAgICA8cHJvZ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IG5vZGVzIGNhbiBiZSBncm91cGVkIHVuZGVyIGFuIG9wdGlvbmFsICdwb3J0cycgbm9kZSwgd2hpY2gKK2FsbG93cyB0byBzcGVjaWZ5ICNhZGRyZXNzLWNlbGxzLCAjc2l6ZS1jZWxscyBwcm9wZXJ0aWVzIGZvciB0aGUgJ3BvcnQnCitub2RlcyBpbmRlcGVuZGVudGx5IGZyb20gYW55IG90aGVyIGNoaWxkIGRldmljZSBub2RlcyBhIGRldmljZSBtaWdodAoraGF2ZS4KKworZGV2aWNlIHsKKyAgICAgICAgLi4uCisgICAgICAgIHBvcnRzIHsKKyAgICAgICAgICAgICAgICAjYWRkcmVzcy1jZWxscyA9IDwxPjsKKyAgICAgICAgICAgICAgICAjc2l6ZS1jZWxscyA9IDwwPjsKKworICAgICAgICAgICAgICAgIHBvcnRAMCB7CisgICAgICAgICAgICAgICAgICAgICAgICAuLi4KKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZHBvaW50QDAgeyAuLi4gfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVuZHBvaW50QDEgeyAuLi4gfTsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgcG9ydEAxIHsgLi4uIH07CisgICAgICAgIH07Cit9OworCitMaW5rcyBiZXR3ZWVuIGVuZHBvaW50cworLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworRWFjaCBlbmRwb2ludCBzaG91bGQgY29udGFpbiBhICdyZW1vdGUtZW5kcG9pbnQnIHBoYW5kbGUgcHJvcGVydHkgdGhhdCBwb2ludHMKK3RvIHRoZSBjb3JyZXNwb25kaW5nIGVuZHBvaW50IGluIHRoZSBwb3J0IG9mIHRoZSByZW1vdGUgZGV2aWNlLiBJbiB0dXJuLCB0aGUKK3JlbW90ZSBlbmRwb2ludCBzaG91bGQgY29udGFpbiBhICdyZW1vdGUtZW5kcG9pbnQnIHByb3BlcnR5LiBJZiBpdCBoYXMgb25lLAoraXQgbXVzdCBub3QgcG9pbnQgdG8gYW5vdGhlciB0aGFuIHRoZSBsb2NhbCBlbmRwb2ludC4gVHdvIGVuZHBvaW50cyB3aXRoIHRoZWlyCisncmVtb3RlLWVuZHBvaW50JyBwaGFuZGxlcyBwb2ludGluZyBhdCBlYWNoIG90aGVyIGZvcm0gYSBsaW5rIGJldHdlZW4gdGhlCitjb250YWluaW5nIHBvcnRzLgorCitkZXZpY2UtMSB7CisgICAgICAgIHBvcnQgeworICAgICAgICAgICAgICAgIGRldmljZV8xX291dHB1dDogZW5kcG9pbnQgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3RlLWVuZHBvaW50ID0gPCZkZXZpY2VfMl9pbnB1dD47CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgfTsKK307CisKK2RldmljZS0yIHsKKyAgICAgICAgcG9ydCB7CisgICAgICAgICAgICAgICAgZGV2aWNlXzJfaW5wdXQ6IGVuZHBvaW50IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmZGV2aWNlXzFfb3V0cHV0PjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICB9OworfTsKKworCitSZXF1aXJlZCBwcm9wZXJ0aWVzCistLS0tLS0tLS0tLS0tLS0tLS0tCisKK0lmIHRoZXJlIGlzIG1vcmUgdGhhbiBvbmUgJ3BvcnQnIG9yIG1vcmUgdGhhbiBvbmUgJ2VuZHBvaW50JyBub2RlIG9yICdyZWcnCitwcm9wZXJ0eSBpcyBwcmVzZW50IGluIHBvcnQgYW5kL29yIGVuZHBvaW50IG5vZGVzIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllcworYXJlIHJlcXVpcmVkIGluIGEgcmVsZXZhbnQgcGFyZW50IG5vZGU6CisKKyAtICNhZGRyZXNzLWNlbGxzIDogbnVtYmVyIG9mIGNlbGxzIHJlcXVpcmVkIHRvIGRlZmluZSBwb3J0L2VuZHBvaW50CisgICAgICAgICAgICAgICAgICAgIGlkZW50aWZpZXIsIHNob3VsZ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dlbiksIGxlZChwMyksIGF1ZGlvKG1jbGspCittcHA0ICAgICAgICAgIDQgICAgICAgIGdwaW8sIGRldihhZDYpLCBzcGkwKG1pc28pLCBzcGkxKG1pc28pCittcHA1ICAgICAgICAgIDUgICAgICAgIGdwaW8sIGRldihhZDcpLCBzcGkwKGNzMiksIHNwaTEoY3MyKQorbXBwNiAgICAgICAgICA2ICAgICAgICBncGlvLCBkZXYoYWQwKSwgbGVkKHAxKSwgYXVkaW8ocmNsaykKK21wcDcgICAgICAgICAgNyAgICAgICAgZ3BpbywgZGV2KGFkMSksIHB0cChjbGspLCBsZWQocDIpLCBhdWRpbyhleHRjbGspCittcHA4ICAgICAgICAgIDggICAgICAgIGdwaW8sIGRldiAoYm9vdGNzKSwgc3BpMChjczApLCBzcGkxKGNzMCkKK21wcDkgICAgICAgICAgOSAgICAgICAgZ3BpbywgbmYod2VuKSwgc3BpMChzY2spLCBzcGkxKHNjaykKK21wcDEwICAgICAgICAxMCAgICAgICAgZ3BpbywgbmYocmVuKSwgZHJhbSh2dHRjdHJsKSwgbGVkKGMxKQorbXBwMTEgICAgICAgIDExICAgICAgICBncGlvLCBkZXYoYTApLCBsZWQoYzIpLCBhdWRpbyhzZG8pCittcHAxMiAgICAgICAgMTIgICAgICAgIGdwaW8sIGRldihhMSksIGF1ZGlvKGJjbGspCittcHAxMyAgICAgICAgMTMgICAgICAgIGdwaW8sIGRldihyZWFkeW4pLCBwY2llMChyc3RvdXRuKSwgcGNpZTEocnN0b3V0bikKK21wcDE0ICAgICAgICAxNCAgICAgICAgZ3BpbywgaTJjMChzZGEpLCB1YXJ0MSh0eGQpCittcHAxNSAgICAgICAgMTUgICAgICAgIGdwaW8sIGkyYzAoc2NrKSwgdWFydDEocnhkKQorbXBwMTYgICAgICAgIDE2ICAgICAgICBncGlvLCB1YXJ0MCh0eGQpCittcHAxNyAgICAgICAgMTcgICAgICAgIGdwaW8sIHVhcnQwKHJ4ZCkKK21wcDE4ICAgICAgICAxOCAgICAg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cGkxKG1pc28pCittcHAzNCAgICAgICAgMzQgICAgICAgIGdwaW8sIGdlMSh0eGNsa291dCksIHNwaTEoc2NrKQorbXBwMzUgICAgICAgIDM1ICAgICAgICBncGlvLCBnZTEocnhjdGwpLCBzcGkxKGNzMSksIHNwaTAoY3MyKQorbXBwMzYgICAgICAgIDM2ICAgICAgICBncGlvLCBwY2llMChjbGtyZXEpCittcHAzNyAgICAgICAgMzcgICAgICAgIGdwaW8sIHBjaWUwKGNsa3JlcSksIHRkbShpbnRuKSwgZ2UobWRjKQorbXBwMzggICAgICAgIDM4ICAgICAgICBncGlvLCBwY2llMShjbGtyZXEpLCBnZShtZGlvKQorbXBwMzkgICAgICAgIDM5ICAgICAgICBncGlvLCByZWYoY2xrb3V0KQorbXBwNDAgICAgICAgIDQwICAgICAgICBncGlvLCB1YXJ0MSh0eGQpCittcHA0MSAgICAgICAgNDEgICAgICAgIGdwaW8sIHVhcnQxKHJ4ZCkKK21wcDQyICAgICAgICA0MiAgICAgICAgZ3Bpbywgc3BpMShjczIpLCBsZWQoYzApCittcHA0MyAgICAgICAgNDMgICAgICAgIGdwaW8sIHNhdGEwKHByc250KSwgZHJhbSh2dHRjdHJsKQorbXBwNDQgICAgICAgIDQ0ICAgICAgICBncGlvLCBzYXRhMChwcnNudCkKK21wcDQ1ICAgICAgICA0NSAgICAgICAgZ3Bpbywgc3BpMChjczIpLCBwY2llMChyc3RvdXRuKQorbXBwNDYgICAgICAgIDQ2ICAgICAgICBncGlvLCBsZWQocDApLCBnZTAodHhkMCksIGdlMSh0eGQwKQorbXBwNDcgICAgICAgIDQ3ICAgICAgICBncGlvLCBsZWQocDEpLCBnZTAodHhkMSksIGdlMSh0eGQxKQorbXBwNDggICAgICAgIDQ4ICAgICAgICBncGlvLCBsZWQocDIpLCBnZTAodHhkMiksIGdlMSh0eGQyKQorbXBwNDkgICAgICAgIDQ5ICAgICAgICBncGlvLCBsZWQocDMpLCBnZTAodHhkMyksIGdlMSh0eGQzKQorbXBwNTAgICAgICAgIDUwICAgICAgICBncGlvLCBsZWQoYzApLCBnZTAocnhkMCksIGdlMShyeGQwKQorbXBwNTEgICAgICAgIDUxICAgICAgICBncGlvLCBsZWQoYzEpLCBnZTAocnhkMSksIGdlMShyeGQxKQorbXBwNTIgICAgICAgIDUyICAgICAgICBncGlvLCBsZWQoYzIpLCBnZTAocnhkMiksIGdlMShyeGQyKQorbXBwNTMgICAgICAgIDUzICAgICAgICBncGlvLCBwY2llMShyc3RvdXRuKSwgZ2UwKHJ4ZDMpLCBnZTEocnhkMykKK21wcDU0ICAgICAgICA1NCAgICAgICAgZ3BpbywgcGNpZTAocnN0b3V0biksIGdlMChyeGN0bCksIGdlMShyeGN0bCkKK21wcDU1ICAgICAgICA1NSAgICAgICAgZ3BpbywgZ2UwKHJ4Y2xrKSwgZ2UxKHJ4Y2xrKQorbXBwNTYgICAgICAgIDU2ICAgICAgICBncGlvLCBnZTAodHhjbGtvdXQpLCBnZTEodHhjbGtvdXQpCittcHA1NyAgICAgICAgNTcgICAgICAgIGdwaW8sIGdlMCh0eGN0bCksIGdlMSh0eGN0bCkKK21wcDU4ICAgICAgICA1OCAgICAgICAgZ3BpbywgbGVkKGMwKQorbXBwNTkgICAgICAgIDU5ICAgICAgICBncGlvLCBsZWQoYzEpCittcHA2MCAgICAgICAgNjAgICAgICAgIGdwaW8sIHVhcnQxKHR4ZCksIGxlZChjMikKK21wcDYxICAgICAgICA2MSAgICAgICAgZ3BpbywgaTJjMShzZGEpLCB1YXJ0MShyeGQpLCBzcGkxKGNzMiksIGxlZChwMCkKK21wcDYyICAgICAgICA2MiAgICAgICAgZ3BpbywgaTJjMShzY2spLCBsZWQocDEpCittcHA2MyAgICAgICAgNjMgICAgICAgIGdwaW8sIHB0cCh0cmlnZ2VuKSwgbGVkKHAyKQorbXBwNjQgICAgICAgIDY0ICAgICAgICBncGlvLCBkcmFtKHZ0dGN0cmwpLCBsZWQocDMpCittcHA2NSAgICAgICAgNjUgICAgICAgIGdw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itOb3RlOiBicmFja2V0cyAoeCkgYXJlIG5vdCBwYXJ0IG9mIHRoZSBtcHAgbmFtZSBmb3IgbWFydmVsbCxmdW5jdGlvbiBhbmQgZ2l2ZW4KK29ubHkgZm9yIG1vcmUgZGV0YWlsZWQgZGVzY3JpcHRpb24gaW4gdGhpcyBkb2N1bWVudC4KKworbmFtZSAgICAgICAgICBwaW5zICAgICBmdW5jdGlvbnMKKz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CittcHAwICAgICAgICAgIDAgICAgICAgIGdwaW8sIHVhMChyeGQpCittcHAxICAgICAgICAgIDEgICAgICAgIGdwaW8sIHVhMCh0eGQpCittcHAyICAgICAgICAgIDIgICAgICAgIGdwaW8sIGkyYzAoc2NrKQorbXBwMyAgICAgICAgICAzICAgICAgICBncGlvLCBpMmMwKHNkYSkKK21wcDQgICAgICAgICAgNCAgICAgICAgZ3BpbywgZ2UobWRjKSwgdWExKHR4ZCksIHVhMChydHMpCittcHA1ICAgICAgICAgIDUgICAgICAgIGdwaW8sIGdlKG1kaW8pLCB1YTEocnhkKSwgdWEwKGN0cykKK21wcDYgICAgICAgICAgNiAgICAgICAgZ3BpbywgZ2UwKHR4Y2xrb3V0KSwgZ2UwKGNycyksIGRldihjczMpCittcHA3ICAgICAgICAgIDcgICAgICAgIGdwaW8sIGdlMCh0eGQwKSwgZGV2KGFkOSkKK21wcDggICAgICAgICAgOCAgICAgICAgZ3BpbywgZ2UwKHR4ZDEpLCBkZXYoYWQxMCkKK21wcDkgICAgICAgICAgOSAgICAgICAgZ3BpbywgZ2UwKHR4ZDIpLCBkZXYoYWQxMSkKK21wcDEwICAgICAgICAgMTAgICAgICAgZ3BpbywgZ2UwKHR4ZDMpLCBkZXYoYWQxMikKK21wcDExICAgICAgICAgMTEgICAgICAgZ3BpbywgZ2UwKHR4Y3RsKSwgZGV2KGFkMTMpCittcHAxMiAgICAgICA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21wcDIxICAgICAgICAgMjEgICAgICAgZ3Bpbywgc3BpMChjczEpLCBnZTEocnhkMCksIHNhdGEwKHByc250KSwgc2QwKGNtZCksIGRldihib290Y3MpCittcHAyMiAgICAgICAgIDIyICAgICAgIGdwaW8sIHNwaTAobW9zaSksIGRldihhZDApCittcHAyMyAgICAgICAgIDIzICAgICAgIGdwaW8sIHNwaTAoc2NrKSwgZGV2KGFkMikKK21wcDI0ICAgICAgICAgMjQgICAgICAgZ3Bpbywgc3BpMChtaXNvKSwgdWEwKGN0cyksIHVhMShyeGQpLCBzZDAoZDQpLCBkZXYocmVhZHkpCittcHAyNSAgICAgICAgIDI1ICAgICAgIGdwaW8sIHNwaTAoY3MwKSwgdWEwKHJ0cyksIHVhMSh0eGQpLCBzZDAoZDUpLCBkZXYoY3MwKQorbXBwMjYgICAgICAgICAyNiAgICAgICBncGlvLCBzcGkwKGNzMiksIGkyYzEoc2NrKSwgc2QwKGQ2KSwgZGV2KGNzMSkKK21wcDI3ICAgICAgICAgMjcgICAgICAgZ3Bpbywgc3BpMChjczMpLCBnZTEodHhjbGtvdXQpLCBpMmMxKHNkYSksIHNkMChkNyksIGRldihjczIpCittcHAyOCAgICAgICAgIDI4ICAgICAgIGdwaW8sIGdlMSh0eGQwKSwgc2QwKGNsayksIGRldihhZDUpCittcHAyOSAgICAgICAgIDI5ICAgICAgIGdwaW8sIGdlMSh0eGQxKSwgZGV2KGFsZTApCittcHAzMCAgICAgICAgIDMwICAgICAgIGdwaW8sIGdlMSh0eGQyKSwgZGV2KG9lbikKK21wcDMxICAgICAgICAgMzEgICAgICAgZ3BpbywgZ2UxKHR4ZDMpLCBkZXYoYWxlMSkKK21wcDMyICAgICAgICAgMzIgICAgICAgZ3BpbywgZ2UxKHR4Y3RsKSwgZGV2KHdlbjApCittcHAzMyAgICAgICAgIDMzICAgICAgIGdwaW8sIG0oZGVjY19lcnIpLCBkZXYoYWQzKQorbXBwMzQgICAgICAgICAzNCAgICAgICBncGlvLCBkZXYoYWQxKQorbXBwMzUgICAgICAgICAzNSAgICAgICBncGlvLCByZWYoY2xrX291dDEpLCBkZXYoYTEpCittcHAzNiAgICAgICAgIDM2ICAgICAgIGdwaW8sIHB0cCh0cmlnX2dlbiksIGRldihhMCkKK21wcDM3ICAgICAgICAgMzcgICAgICAgZ3BpbywgcHRwKGNsayksIGdlMShyeGNsayksIHNkMChkMyksIGRldihhZDgpCittcHAzOCAgICAgICAgIDM4ICAgICAgIGdwaW8sIHB0cChldmVudF9yZXEpLCBnZTEocnhkMSksIHJlZihjbGtfb3V0MCksIHNkMChkMCksIGRldihhZDQpCittcHAzOSAgICAgICAgIDM5ICAgICAgIGdwaW8sIGkyYzEoc2NrKSwgZ2UxKHJ4ZDIpLCB1YTAoY3RzKSwgc2QwKGQxKSwgZGV2KGEyKQorbXBwNDAgICAgICAgICA0MCAgICAgICBncGlvLCBpMmMxKHNkYSksIGdlMShyeGQzKSwgdWEwKHJ0cyksIHNkMChkMiksIGRldihhZDYpCittcHA0MSAgICAgICAgIDQxICAgICAgIGdwaW8sIHVhMShyeGQpLCBnZTEocnhjdGwpLCB1YTAoY3RzKSwgc3BpMShjczMpLCBkZXYoYnVyc3QvbGFzdCkKK21wcDQyICAgICAgICAgNDIgICAgICAgZ3BpbywgdWExKHR4ZCksIHVhMChydHMpLCBkZXYoYWQ3KQorbXBwNDMgICAgICAgICA0MyAgICAgICBncGlvLCBwY2llMChjbGtyZXEpLCBtKHZ0dF9jdHJsKSwgbShkZWNjX2VyciksIHBjaWUwKHJzdG91dCksIGRldihjbGtvdXQpCittcHA0NCAgICAgICAgIDQ0ICAgICAgIGdwaW8sIHNhdGEwKHByc250KSwgc2F0YTEocHJzbnQpLCBzYXRhMihwcnNudCkgWzJdLCBzYXRhMyhwcnNudCkgWzNdLCBwY2llMChyc3RvdXQpCittcHA0NSAgICAgICAgIDQ1ICAgICAgIGdwaW8sIHJlZihjbGtfb3V0MCksIHBjaWUwKHJzdG91dCksIHBjaWUxKHJzdG91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MDQ+OworICAgICAgICAgICAgICAgIGdwciA9IDwmZ3ByPjsKKyAgICAgICAgICAgICAgICBjbG9ja3MgPSA8JmNsa3MgMTIzPiwgPCZjbGtzIDEyND47CisgICAgICAgICAgICAgICAgY2xvY2stbmFtZXMgPSAiaWFoYiIsICJpc2ZyIjsKKyAgICAgICAgICAgICAgICBkZGMtaTJjLWJ1cyA9IDwmaTJjMj47CisKKyAgICAgICAgICAgICAgICBwb3J0QDAgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVnID0gPDA+OworCisgICAgICAgICAgICAgICAgICAgICAgICBoZG1pX211eF8wOiBlbmRwb2ludCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmaXB1MV9kaTBfaGRtaT47CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBwb3J0QDEgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVnID0gPDE+OworCisgICAgICAgICAgICAgICAgICAgICAgICBoZG1pX211eF8xOiBlbmRwb2ludCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZS1lbmRwb2ludCA9IDwmaXB1MV9kaTFfaGRtaT47CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH07CisgICAgICAgIH07CmRpZmYgLS1naXQgYS9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3Mvc3RhZ2luZy9pbXgtZHJtL2xkYi50eHQgYi9Eb2N1bWVudGF0aW9uL2RldmljZXRyZWUvYmluZGluZ3Mvc3RhZ2luZy9pbXgtZHJtL2xkYi50eHQKaW5kZXggZWQ5Mzc3OC4uNTc4YTFmYyAxMDA2NDQKLS0tIGEvRG9jdW1lbnRhdGlvbi9kZXZpY2V0cmVlL2JpbmRpbmdzL3N0YWdpbmcvaW14LWRybS9sZGIudHh0CisrKyBiL0RvY3VtZW50YX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JCXJldHVybiBlcnI7CisKKwllcnIgPSBtc3JfcmVhZChtc3IsICZtKTsKKwlpZiAoZXJyKQorCQlyZXR1cm4gZXJyOworCisJbTEgPSBtOworCWlmIChzZXQpCisJCW0xLnEgfD0gIEJJVF82NChiaXQpOworCWVsc2UKKwkJbTEucSAmPSB+QklUXzY0KGJpdCk7CisKKwlpZiAobTEucSA9PSBtLnEpCisJCXJldHVybiAwOworCisJZXJyID0gbXNyX3dyaXRlKG1zciwgJm0pOworCWlmIChlcnIpCisJCXJldHVybiBlcnI7CisKKwlyZXR1cm4gMTsKK30KKworLyoqCisgKiBTZXQgQGJpdCBpbiBhIE1TUiBAbXNyLgorICoKKyAqIFJldHZhbDoKKyAqIDwgMDogQW4gZXJyb3Igd2FzIGVuY291bnRlcmVkLgorICogPSAwOiBCaXQgd2FzIGFscmVhZHkgc2V0LgorICogPiAwOiBIYXJkd2FyZSBhY2NlcHRlZCB0aGUgTVNSIHdyaXRlLgorICovCitpbnQgbXNyX3NldF9iaXQodTMyIG1zciwgdTggYml0KQoreworCXJldHVybiBfX2ZsaXBfYml0KG1zciwgYml0LCB0cnVlKTsKK30KKworLyoqCisgKiBDbGVhciBAYml0IGluIGEgTVNSIEBtc3IuCisgKgorICogUmV0dmFsOgorICogPCAwOiBBbiBlcnJvciB3YXMgZW5jb3VudGVyZWQuCisgKiA9IDA6IEJpdCB3YXMgYWxyZWFkeSBjbGVhcmVkLgorICogPiAwOiBIYXJkd2FyZSBhY2NlcHRlZCB0aGUgTVNSIHdyaXRlLgorICovCitpbnQgbXNyX2NsZWFyX2JpdCh1MzIgbXNyLCB1OCBiaXQpCit7CisJcmV0dXJuIF9fZmxpcF9iaXQobXNyLCBiaXQsIGZhbHNlKTsKK30KZGlmZiAtLWdpdCBhL2FyY2gveDg2L21tL2R1bXBfcGFnZXRhYmxlcy5jIGIvYXJjaC94ODYvbW0vZHVtcF9wYWdldGFibGVzLmMKaW5kZXggMDAwMmEzYS4uMjA2MjFkNyAxMDA2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dwcm90X3QgdG8gdGhlIHNlcV9maWxlCiAgKi8KLXN0YXRpYyB2b2lkIHByaW50a19wcm90KHN0cnVjdCBzZXFfZmlsZSAqbSwgcGdwcm90X3QgcHJvdCwgaW50IGxldmVsKQorc3RhdGljIHZvaWQgcHJpbnRrX3Byb3Qoc3RydWN0IHNlcV9maWxlICptLCBwZ3Byb3RfdCBwcm90LCBpbnQgbGV2ZWwsIGJvb2wgZG1zZykKIHsKIAlwZ3Byb3R2YWxfdCBwciA9IHBncHJvdF92YWwocHJvdCk7CiAJc3RhdGljIGNvbnN0IGNoYXIgKiBjb25zdCBsZXZlbF9uYW1lW10gPQpAQCAtOTksNDcgKzExOCw0NyBAQAogCiAJaWYgKCFwZ3Byb3RfdmFsKHByb3QpKSB7CiAJCS8qIE5vdCBwcmVzZW50ICovCi0JCXNlcV9wcmludGYobSwgIiAgICAgICAgICAgICAgICAgICAgICAgICAgIik7CisJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIiAgICAgICAgICAgICAgICAgICAgICAgICAgIik7CiAJfSBlbHNlIHsKIAkJaWYgKHByICYgX1BBR0VfVVNFUikKLQkJCXNlcV9wcmludGYobSwgIlVTUiAiKTsKKwkJCXB0X2R1bXBfY29udF9wcmludGYobSwgZG1zZywgIlVTUiAiKTsKIAkJZWxzZQotCQkJc2VxX3ByaW50ZihtLCAiICAgICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiICAgICIpOwogCQlpZiAocHIgJiBfUEFHRV9SVykKLQkJCXNlcV9wcmludGYobSwgIlJXICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAiUlcgIik7CiAJCWVsc2UKLQkJCXNlcV9wcmludGYobSwgInJvICIpOworCQkJcHRfZHVtcF9jb250X3ByaW50ZihtLCBkbXNnLCAicm8gIik7CiAJCWlmIChwciAmIF9QQUdFX1BXVCkKLQkJCXNlcV9wcmludGYobSwgIlBXVCAiKTsKKwkJCXB0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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTM3NCwxMSArMzYyLDExIEBACiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLUFDUElfRVhURVJOIHN0cnVjdCBhY3BpX3RocmVhZF9zdGF0ZSAqYWNwaV9nYmxfY3VycmVudF93YWxrX2xpc3Q7CitBQ1BJX0dMT0JBTChzdHJ1Y3QgYWNwaV90aHJlYWRfc3RhdGUgKiwgYWNwaV9nYmxfY3VycmVudF93YWxrX2xpc3QpOwogCiAvKiBDb250cm9sIG1ldGhvZCBzaW5nbGUgc3RlcCBmbGFnICovCiAKLUFDUElfRVhURVJOIHU4IGFjcGlfZ2JsX2NtX3NpbmdsZV9zdGVwOworQUNQSV9HTE9CQUwodTgsIGFjcGlfZ2JsX2NtX3NpbmdsZV9zdGVwKTsKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgpAQCAtMzg4LDggKzM3Niw5IEBACiAKIGV4dGVybiBzdHJ1Y3QgYWNwaV9iaXRfcmVnaXN0ZXJfaW5mbwogICAgIGFjcGlfZ2JsX2JpdF9yZWdpc3Rlcl9pbmZvW0FDUElfTlVNX0JJVFJFR107Ci1BQ1BJX0VYVEVSTiB1OCBhY3BpX2dibF9zbGVlcF90eXBlX2E7Ci1BQ1BJX0VYVEVSTiB1OCBhY3BpX2dibF9zbGVlcF90eXBlX2I7CisKK0FDUElfR0xPQkFMKHU4LCBhY3BpX2dibF9zbGVlcF90eXBlX2EpOworQUNQSV9HTE9CQUwodTgsIGFjcGlfZ2JsX3NsZWVwX3R5cGVfYik7CiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKQEAgLTM5OS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ZXIuaCBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvYWNwYXJzZXIuaAppbmRleCBhZWQzMTkzLi42MTY4Yjg1IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2FjcGFyc2VyLmgKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY3BhcnNlci5oCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9hY3ByZWRlZi5oIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY3ByZWRlZi5oCmluZGV4IGY2MDBhZGVkLi5hNDhkNzEzIDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2FjcHJlZGVmLmgKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9hY3ByZWRlZi5oCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9u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ZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZWluaXQuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXZncGVpbml0LmMKaW5kZXggYTNlMmYzOC4uYWU3NzljMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZWluaXQuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2Z3BlaW5pdC5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZXV0aWwuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXZncGV1dGlsLmMKaW5kZXggNGQ3NjRlOC4uMTdlNGJiZiAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldmdwZXV0aWwuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2Z3BldXRpbC5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgK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mLi4xYjE0OGE0IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2cmduaW5pLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS9ldnJnbmluaS5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9ldnNjaS5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9ldnNjaS5jCmluZGV4IDllOWUzNDUuLjRkOGE3MDkgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXZzY2kuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V2c2NpLmMKQEAgLTYsNyArNiw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9leGR1bXAuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvZXhkdW1wLmMKaW5kZXggNGQwNDZmYS4uOTczZmRhZSAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS9leGR1bXAuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL2V4ZHVtcC5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtOTQsMTIgKzk0LDEzIEBACiAJe0FDUElfRVhEX0lOSVQsIEFDUElfRVhEX1RBQkxFX1NJWkUoYWNwaV9leF9kdW1wX2J1ZmZlciksIE5VTEx9LAogCXtBQ1BJX0VYRF9VSU5UMzIsIEFDUElfRVhEX09GRlNFVChidWZmZXIubGVuZ3RoKSwgIkxlbmd0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bmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC05MjMsMTkgKzkyMywyMiBAQAogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoKLSAqIEZVTkNUSU9OOiAgICBhY3BpX2dldF9kYXRhCisgKiBGVU5DVElPTjogICAgYWNwaV9nZXRfZGF0YV9mdWxsCiAgKgogICogUEFSQU1FVEVSUzogIG9ial9oYW5kbGUgICAgICAgICAgLSBOYW1lc3BhY2Ugbm9kZQogICogICAgICAgICAgICAgIGhhbmRsZXIgICAgICAgICAgICAgLSBIYW5kbGVyIHVzZWQgaW4gY2FsbCB0byBhdHRhY2hfZGF0YQogICogICAgICAgICAgICAgIGRhdGEgICAgICAgICAgICAgICAgLSBXaGVyZSB0aGUgZGF0YSBpcyByZXR1cm5lZAorICogICAgICAgICAgICAgIGNhbGxiYWNrICAgICAgICAgICAgLSBmdW5jdGlvbiB0byBleGVjdXRlIGJlZm9yZSByZXR1cm5pbmcKICAqCiAgKiBSRVRVUk46ICAgICAgU3RhdHVzCiAgKgotICogREVTQ1JJUFRJT046IFJldHJpZXZlIGRhdGEgdGhhdCB3YXMgcHJldmlvdXNseSBhdHRhY2hlZCB0byBhIG5hbWVzcGFjZSBub2RlLgorICogREVTQ1JJUFRJT046IFJldHJpZXZlIGRhdGEgdGhhdCB3YXMgcHJldmlvdXNseSBhdHRhY2hlZCB0byBhIG5hbWVzcGFjZSBub2RlCisgKiAgICAgICAgICAgICAgYW5kIGV4ZWN1dGUgYSBjYWxsYmFjayBiZWZvcmUgcmV0dXJuaW5nLgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiBhY3BpX3N0YXR1cwotYWNwaV9nZXRfZGF0YShhY3BpX2hhbmRsZSBvYmpfaGFuZGxlLCBhY3BpX29iam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Y3BpL2FjcGljYS9yc2xpc3QuYwppbmRleCA2MDUzYWExLi43NzI5MTI5IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3JzbGlzdC5jCisrKyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvcnNsaXN0LmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApkaWZmIC0tZ2l0IGEvZHJpdmVycy9hY3BpL2FjcGljYS9yc21lbW9yeS5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS9yc21lbW9yeS5jCmluZGV4IGViYzc3M2EuLmVhYjQ0ODMgMTAwNjQ0Ci0tLSBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvcnNtZW1vcnkuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3JzbWVtb3J5LmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZ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hY3BpY2EvdXRwcmVkZWYuYwpAQCAtNSw3ICs1LDcgQEAKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoKLSAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTMsIEludGVsIENvcnAuCisgKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE0LCBJbnRlbCBDb3JwLgogICogQWxsIHJpZ2h0cyByZXNlcnZlZC4KICAqCiAgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXRyZXNyYy5jIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dHJlc3JjLmMKaW5kZXggMmMyYWNjYi4uMTRjYjZjMCAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS91dHJlc3JjLmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dHJlc3JjLmMKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dApAQCAtNDcsNyArNDcsOCBAQAogCiAjZGVmaW5lIF9DT01QT05FTlQgICAgICAgICAgQUNQSV9VVElMSVRJRVMKIEFDUElfTU9EVU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ZmVycm9yLmMKaW5kZXggZjdlZGI4OC4uZWRkODYxMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9hY3BpL2FjcGljYS91dHhmZXJyb3IuYworKysgYi9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0eGZlcnJvci5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogLyoKLSAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTMsIEludGVsIENvcnAuCisgKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDE0LCBJbnRlbCBDb3JwLgogICogQWxsIHJpZ2h0cyByZXNlcnZlZC4KICAqCiAgKiBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQKZGlmZiAtLWdpdCBhL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXR4ZmluaXQuYyBiL2RyaXZlcnMvYWNwaS9hY3BpY2EvdXR4ZmluaXQuYwppbmRleCAyNDZlZjY4Li4xMzM4MGQ4IDEwMDY0NAotLS0gYS9kcml2ZXJzL2FjcGkvYWNwaWNhL3V0eGZpbml0LmMKKysrIGIvZHJpdmVycy9hY3BpL2FjcGljYS91dHhmaW5pdC5jCkBAIC01LDcgKzUsNyBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAvKgotICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxMywgSW50ZWwgQ29ycC4KKyAqIENvcHlyaWdodCAoQykgMjAwMCAtIDIwMTQsIEludGVsIENvcnAuCiAgKiBBbGwgcmlnaHRzIHJlc2VydmVkLgogICoKICAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCB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XZpY2UgbWF0Y2hlcyB0aGUgaGFuZGxlLCByZXR1cm4uCiAgKi8KIHN0YXRpYyBzdHJ1Y3QgZG9ja19kZXBlbmRlbnRfZGV2aWNlICoKLWZpbmRfZG9ja19kZXBlbmRlbnRfZGV2aWNlKHN0cnVjdCBkb2NrX3N0YXRpb24gKmRzLCBhY3BpX2hhbmRsZSBoYW5kbGUpCitmaW5kX2RvY2tfZGVwZW5kZW50X2RldmljZShzdHJ1Y3QgZG9ja19zdGF0aW9uICpkcywgc3RydWN0IGFjcGlfZGV2aWNlICphZGV2KQogewogCXN0cnVjdCBkb2NrX2RlcGVuZGVudF9kZXZpY2UgKmRkOwogCiAJbGlzdF9mb3JfZWFjaF9lbnRyeShkZCwgJmRzLT5kZXBlbmRlbnRfZGV2aWNlcywgbGlzdCkKLQkJaWYgKGhhbmRsZSA9PSBkZC0+aGFuZGxlKQorCQlpZiAoYWRldiA9PSBkZC0+YWRldikKIAkJCXJldHVybiBkZDsKIAogCXJldHVybiBOVUxMOwogfQogCit2b2lkIHJlZ2lzdGVyX2RvY2tfZGVwZW5kZW50X2RldmljZShzdHJ1Y3QgYWNwaV9kZXZpY2UgKmFkZXYsCisJCQkJICAgIGFjcGlfaGFuZGxlIGRzaGFuZGxlKQoreworCXN0cnVjdCBkb2NrX3N0YXRpb24gKmRzID0gZmluZF9kb2NrX3N0YXRpb24oZHNoYW5kbGUpOworCisJaWYgKGRzICYmICFmaW5kX2RvY2tfZGVwZW5kZW50X2RldmljZShkcywgYWRldikpCisJCWFkZF9kb2NrX2RlcGVuZGVudF9kZXZpY2UoZHMsIGFkZXYpOworfQorCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqICAgICAgICAgICAgICAgICAgICAgICAgIERvY2sgZnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgogICoqKioqKioqKioqKioqKioqKioqKio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fTVBVNjA1MF9SRUdfVVNFUl9DVFJMICAgICAgICAgICAweDZBCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX1JTVCAgICAgICAgICAgICAgICAgICAgMHgwNAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX1JTVCAgICAgICAgICAgICAgICAgICAgIDB4MDgKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0kyQ19NU1RfRU4gICAgICAgICAgICAgICAgICAweDIwCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9GSUZPX0VOICAgICAgICAgICAgICAgICAgICAgMHg0MAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0VOICAgICAgICAgICAgICAgICAgICAgIDB4ODAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0ZJRk9fUlNUICAgICAgICAgICAgMHgwNAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX1JTVCAgICAgICAgICAgICAweDA4CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9JMkNfTVNUX0VOICAgICAgICAgIDB4MjAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX0ZJRk9fRU4gICAgICAgICAgICAgMHg0MAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfRE1QX0VOICAgICAgICAgICAgICAweDgwCiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX1BXUl9NR01UXzEgICAgICAgICAgMHg2QgotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfSF9SRVNFVCAgICAgICAgICAgICAgICAgICAgIDB4ODAKLSNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1NMRUVQICAgICAgICAgICAgICAgICAgICAgICAweDQwCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9DTEtfTUFTSyAgICAgICAgICAgICAgICAgICAgMHg3CisjZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9IX1JFU0VUICAgICAgICAgICAgIDB4ODAKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1NMRUVQICAgICAgICAgICAgICAgMHg0MAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfQ0xLX01BU0sgICAgICAgICAgICAweDcKIAogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfUFdSX01HTVRfMiAgICAgICAgICAweDZDCi0jZGVmaW5lIElOVl9NUFU2MDUwX0JJVF9QV1JfQUNDTF9TVEJZICAgICAgICAgICAgICAgMHgzOAotI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfUFdSX0dZUk9fU1RCWSAgICAgICAgICAgICAgIDB4MDcKKyNkZWZpbmUgSU5WX01QVTYwNTBfQklUX1BXUl9BQ0NMX1NUQlkgICAgICAgMHgzOAorI2RlZmluZSBJTlZfTVBVNjA1MF9CSVRfUFdSX0dZUk9fU1RCWSAgICAgICAweDA3CiAKICNkZWZpbmUgSU5WX01QVTYwNTBfUkVHX0ZJRk9fQ09VTlRfSCAgICAgICAgMHg3MgogI2RlZmluZSBJTlZfTVBVNjA1MF9SRUdfRklGT19SX1cgICAgICAgICAgICAweDc0CkBAIC0xODAsMTAgKzE4MCwxMCBAQAogCiAvKiBpbml0IHBhcmFtZXRlcnMgKi8KICNkZWZpbmUgSU5WX01QVTYwNTBfSU5JVF9GSUZPX1JBVEUgICAgICAgICAgIDUwCi0jZGVmaW5lIElOVl9NUFU2MDUwX1RJTUVfU1RBTVBfVE9SICAgICAgICAgICAgICAgICAgICAgICAgNQotI2RlZmluZSBJTlZfTVBVNjA1MF9NQVhfRklGT19SQVRFICAgICAgICAgICAgICAgICAgICAgICAgIDEwMDAKLSNkZWZpbmUgSU5WX01QVTYwNTBfTUlOX0ZJRk9fUkFURSAgICAgICAgICAgICAgICAgICAgICAgICA0Ci0jZGVmaW5lIElOVl9NUFU2MDUwX09ORV9LX0haICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMAorI2RlZmluZSBJTlZfTVBVNjA1MF9USU1FX1NUQU1QX1R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LCBidWYsCisJCWlpb19nZXRfdGltZV9ucygpKTsKKworZG9uZToKKwlpaW9fdHJpZ2dlcl9ub3RpZnlfZG9uZShpbmRpb19kZXYtPnRyaWcpOworCisJcmV0dXJuIElSUV9IQU5ETEVEOworfQorCitzdGF0aWMgaW50IGx0cjUwMV9pbml0KHN0cnVjdCBsdHI1MDFfZGF0YSAqZGF0YSkKK3sKKwlpbnQgcmV0OworCisJcmV0ID0gaTJjX3NtYnVzX3JlYWRfYnl0ZV9kYXRhKGRhdGEtPmNsaWVudCwgTFRSNTAxX0FMU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+YWxzX2NvbnRyID0gcmV0IHwgTFRSNTAxX0NPTlRSX0FDVElWRTsKKworCXJldCA9IGkyY19zbWJ1c19yZWFkX2J5dGVfZGF0YShkYXRhLT5jbGllbnQsIExUUjUwMV9QU19DT05UUik7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJZGF0YS0+cHNfY29udHIgPSByZXQgfCBMVFI1MDFfQ09OVFJfQUNUSVZFOworCisJcmV0dXJuIGx0cjUwMV93cml0ZV9jb250cihkYXRhLT5jbGllbnQsIGRhdGEtPmFsc19jb250ciwKKwkJZGF0YS0+cHNfY29udHIpOworfQorCitzdGF0aWMgaW50IGx0cjUwMV9wcm9iZShzdHJ1Y3QgaTJjX2NsaWVudCAqY2xpZW50LAorCQkJICBjb25zdCBzdHJ1Y3QgaTJjX2RldmljZV9pZCAqaWQpCit7CisJc3RydWN0IGx0cjUwMV9kYXRhICpkYXRhOworCXN0cnVjdCBpaW9fZGV2ICppbmRpb19kZXY7CisJaW50IHJldDsKKworCWluZGlvX2RldiA9IGRldm1faWlvX2RldmljZV9hbGxvYygmY2xpZW50LT5kZXYsIHNpemVvZigqZGF0YSkpOworCWlmICghaW5kaW9fZGV2KQorCQlyZXR1cm4gLUVOT01FTTsKKworCWRhdGEgPSBpaW9fcHJpdihpbmRpb19kZXYpOworCWk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0ID0gc2NobWl0dF9iLAkJCQlcCkBAIC0yNTE2LDE0ICsxNjIzLDEzIEBACiAJCS5zbHdyX3dpZHRoID0gc2x3cl93LAkJCQkJXAogCQkuc2x3Zl9iaXQgPSBzbHdmX2IsCQkJCQlcCiAJCS5zbHdmX3dpZHRoID0gc2x3Zl93LAkJCQkJXAotCQkuZHJ2dHlwZV9yZWcgPSBEUlZfUElOR1JPVVBfRFZSVFlQRV8jI2RydnR5cGUociksCVwKKwkJLmRydnR5cGVfcmVnID0gRFJWX1BJTkdST1VQX1JFR18jI2RydnR5cGUociksCQlcCiAJCS5kcnZ0eXBlX2JhbmsgPSAwLAkJCQkJXAogCQkuZHJ2dHlwZV9iaXQgPSA2LAkJCQkJXAogCX0KIAogc3RhdGljIGNvbnN0IHN0cnVjdCB0ZWdyYV9waW5ncm91cCB0ZWdyYTExNF9ncm91cHNbXSA9IHsKIAkvKiAgICAgICBwZ19uYW1lLCAgICAgICAgICAgICAgICBmMCwgICAgICAgICBmMSwgICAgICAgICBmMiwgICAgICAgICAgIGYzLCAgICAgICAgICBzYWZlLCAgICAgciwgICAgICBvZCwgaW9yLCByY3Zfc2VsICovCi0JLyogRklYTUU6IEZpbGwgaW4gY29ycmVjdCBkYXRhIGluIHNhZmUgY29sdW1uICovCiAJUElOR1JPVVAodWxwaV9kYXRhMF9wbzEsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwMCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMV9wbzIsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwNCwgIE4sICBOLCAgTiksCiAJUElOR1JPVVAodWxwaV9kYXRhMl9wbzMsICAgICAgICAgU1BJMywgICAgICAgSFNJLCAgICAgICAgVUFSVEEsICAgICAgICBVTFBJLCAgICAgICAgVUxQSSwgICAgIDB4MzAwOCwgIE4sICBOLCAgTiksCkBAIC0yNjM1LDYgKzE3NDEsNyBAQAogCVBJTkdST1VQKHBiYjYsICAgICAgICAgICAgICAgICAgIFZHUDYsICAgICAgIERJU1BMQVlBLCAgIERJU1BMQVlCLCAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYTQsICBOLCAgTiwgIE4pLAogCVBJTkdST1VQKHBiYjcsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYTgsICBOLCAgTiwgIE4pLAogCVBJTkdST1VQKHBjYzIsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYWMsICBOLCAgTiwgIE4pLAorCVBJTkdST1VQKGp0YWdfcnRjaywgICAgICAgICAgICAgIFJUQ0ssICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJUQ0ssICAgICAweDMyYjAsICBOLCAgTiwgIE4pLAogCVBJTkdST1VQKHB3cl9pMmNfc2NsX3B6NiwgICAgICAgIEkyQ1BXUiwgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYjQsICBZLCAgTiwgIE4pLAogCVBJTkdST1VQKHB3cl9pMmNfc2RhX3B6NywgICAgICAgIEkyQ1BXUiwgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYjgsICBZLCAgTiwgIE4pLAogCVBJTkdST1VQKGtiX3JvdzBfcHIwLCAgICAgICAgICAgIEtCQywgICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFJTVkQ0LCAgICAweDMyYmMsICBOLCAgTiwgIE4pLApAQCAtMjY2MSw2ICsxNzY4LDcgQEAKIAlQSU5HUk9VUChjb3JlX3B3cl9yZXEsICAgICAgICAgICBQV1JPTiwgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzI0LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChjcHVfcHdyX3JlcSwgICAgICAgICAgICBDUFUsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzI4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChwd3JfaW50X24sICAgICAgICAgICAgICBQTUksICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzJjLCAgTiwgIE4sICBOKSwKKwlQSU5HUk9VUChjbGtfMzJrX2luLCAgICAgICAgICAgICBDTEssICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBDTEssICAgICAgMHgzMzMwLCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChvd3IsICAgICAgICAgICAgICAgICAgICBPV1IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM0LCAgTiwgIE4sICBZKSwKIAlQSU5HUk9VUChkYXAxX2ZzX3BuMCwgICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMHgzMzM4LCAgTiwgIE4sICBOKSwKIAlQSU5HUk9VUChkYXAxX2Rpbl9wbjEsICAgICAgICAgICBJMlMwLCAgICAgICBIREEsICAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBSU1ZENCwgICAgMH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TUksICAgICAgICAgIERJU1BMQVlCLCAgICBQV00xLCAgICAgICAweDMxOTQsICBOLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKHB1NSwgICAgICAgICAgICAgICAgICAgIFBXTTIsICAgICAgIFVBUlRBLCAgICAgIEdNSSwgICAgICAgICAgRElTUExBWUIsICAgIFBXTTIsICAgICAgIDB4MzE5OCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAocHU2LCAgICAgICAgICAgICAgICAgICAgUFdNMywgICAgICAgVUFSVEEsICAgICAgUlNWRDMsICAgICAgICBHTUksICAgICAgICAgUlNWRDMsICAgICAgMHgzMTljLCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTAsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKGdlbjFfaTJjX3NkYV9wYzUsICAgICAgIEkyQzEsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIEkyQzEsICAgICAgIDB4MzFhNCwgIFksICBOLCAgTiksCisgICAgICAgUElOR1JPVVAoZ2VuMV9pMmNfc2RhX3BjNSwgICAgICAgSTJDMSwgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJDMSwgICAgICAgMHgzMWEwLCAgWSwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChnZW4xX2kyY19zY2xfcGM0LCAgICAgICBJMkMxLCAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBJMkMxLCAgICAgICAweDMxYTQsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGRhcDRfZnNfcHA0LCAgICAgICAgICAgIEkyUzMsICAgICAgIEdNSSwgICAgICAgIERUViwgICAgICAgICAgUlNWRDQsICAgICAgIEkyUzMsICAgICAgIDB4MzFhOCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAoZGFwNF9kaW5fcHA1LCAgICAgICAgICAgSTJTMywgICAgICAgR01JLCAgICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgSTJTMywgICAgICAgMHgzMWFjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChkYXA0X2RvdXRfcHA2LCAgICAgICAgICBJMlMzLCAgICAgICBHTUksICAgICAgICBEVFYsICAgICAgICAgIFJTVkQ0LCAgICAgICBJMlMzLCAgICAgICAweDMxYjAsICBOLCAgTiwgIE4pLApAQCAtMjk2NCw5ICsxODU5LDkgQEAKICAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0NF9wYWE0LCAgICAgICBTRE1NQzQsICAgICBTUEkzLCAgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyNzAsICBOLCAgWSwgIE4pLAogICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ1X3BhYTUsICAgICAgIFNETU1DNCwgICAgIFNQSTMsICAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3NCwgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoc2RtbWM0X2RhdDZfcGFhNiwgICAgICAgU0RNTUM0LCAgICAgU1BJMywgICAgICAgR01JLCAgICAgICAgICBSU1ZENCwgICAgICAgU0RNTUM0LCAgICAgMHgzMjc4LCAgTiwgIFksICBOKSwKLSAgICAgICBQSU5HUk9VUChzZG1tYzRfZGF0N19wYWE3LCAgICAgICBTRE1NQzQsICAgICBSU1ZEMSwgICAgICBHTUksICAgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzQsICAgICAweDMyN2MsICBOLCAgWSwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jNF9kYXQ3X3BhYTcsICAgICAgIFNETU1DNCwgICAgIFJTVkQyLCAgICAgIEdNSSwgICAgICAgICAgUlNWRDQsICAgICAgIFNETU1DNCwgICAgIDB4MzI3YywgIE4sICBZLCAgTiksCiAgICAgICAgUElOR1JPVVAoY2FtX21jbGtfcGNjMCwgICAgICAgICAgVkksICAgICAgICAgVklfQUxUMSwgICAgVklfQUxUMywgICAgICBTRE1NQzIsICAgICAgVkksICAgICAgICAgMHgzMjg0LCAgTiwgIE4sICBOKSwKLSAgICAgICBQSU5HUk9VUChwY2MxLCAgICAgICAgICAgICAgICAgICBJMlM0LCAgICAgICBSU1ZEMSwgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBJMlM0LCAgICAgICAweDMyODgsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHBjYzEsICAgICAgICAgICAgICAgICAgIEkyUzQsICAgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIEkyUzQsICAgICAgIDB4MzI4OCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAocGJiMCwgICAgICAgICAgICAgICAgICAgVkdQNiwgICAgICAgVklNQ0xLMiwgICAgU0RNTUMyLCAgICAgICBWSU1DTEsyX0FMVCwgVkdQNiwgICAgICAgMHgzMjhjLCAgTiwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUChjYW1faTJjX3NjbF9wYmIxLCAgICAgICBWR1AxLCAgICAgICBJMkMzLCAgICAgICBSU1ZEMywgICAgICAgIFNETU1DMiwgICAgICBWR1AxLCAgICAgICAweDMyOTAsICBZLCAgTiwgIE4pLAogICAgICAgIFBJTkdST1VQKGNhbV9pMmNfc2RhX3BiYjIsICAgICAgIFZHUDIsICAgICAgIEkyQzMsICAgICAgIFJTVkQzLCAgICAgICAgU0RNTUMyLCAgICAgIFZHUDIsICAgICAgIDB4MzI5NCwgIFksICBOLCAgTiksCkBAIC0zMDQ3LDggKzE5NDIsOCBAQAogICAgICAgIFBJTkdST1VQKGdwaW9fdzNfYXVkX3B3MywgICAgICAgIFNQSTYsICAgICAgIFNQSTEsICAgICAgIFNQSTIsICAgICAgICAgSTJDMSwgICAgICAgIFNQSTEsICAgICAgIDB4MzNmMCwgIE4sICBOLCAgTiksCiAgICAgICAgUElOR1JPVVAodXNiX3ZidXNfZW4wX3BuNCwgICAgICAgVVNCLCAgICAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgVVNCLCAgICAgICAgMHgzM2Y0LCAgWSwgIE4sICBOKSwKICAgICAgICBQSU5HUk9VUCh1c2JfdmJ1c19lbjFfcG41LCAgICAgICBVU0IsICAgICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBVU0IsICAgICAgICAweDMzZjgsICBZLCAgTiwgIE4pLAotICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzNmYywgIE4sICBOLCAgTiksCi0gICAgICAgUElOR1JPVVAoc2RtbWMzX2Nsa19sYl9pbl9wZWU1LCAgU0RNTUMzLCAgICAgUlNWRDIsICAgICAgUlNWRDMsICAgICAgICBSU1ZENCwgICAgICAgU0RNTUMzLCAgICAgMHgzNDAwLCAgTiwgIE4sICBOKSwKKyAgICAgICBQSU5HUk9VUChzZG1tYzNfY2xrX2xiX2luX3BlZTUsICBTRE1NQzMsICAgICBSU1ZEMiwgICAgICBSU1ZEMywgICAgICAgIFJTVkQ0LCAgICAgICBTRE1NQzMsICAgICAweDMzZmMsICBOLCAgTiwgIE4pLAorICAgICAgIFBJTkdST1VQKHNkbW1jM19jbGtfbGJfb3V0X3BlZTQsIFNETU1DMywgICAgIFJTVkQyLCAgICAgIFJTVkQzLCAgICAgICAgUlNWRDQsICAgICAgIFNETU1DMywgICAgIDB4MzQwMCw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zaWduZWQgaW50IG1zaW9mMV9zeW5jX2NfbXV4W10gPSB7CisJTVNJT0YxX1NZTkNfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4X2NfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDIsIDE4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9jX211eFtdID0geworCU1TSU9GMV9SWERfQ19NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4X2NfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDIsIDE3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9jX211eFtdID0geworCU1TSU9GMV9UWERfQ19NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2RfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDAsIDI4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfZF9tdXhbXSA9IHsKKwlNU0lPRjFfU0NLX0RfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zeW5jX2RfcGluc1tdID0geworCS8qIFNZTkMgKi8KKwlSQ0FSX0dQX1BJTigwLCAzMCksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19kX211eFtdID0geworCU1TSU9GMV9TWU5DX0RfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zczFfZF9waW5zW10gPSB7CisJLyogU1MxICovCisJUkNBUl9HUF9QSU4oMCwgMjkpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3NzMV9kX211eFtdID0geworCU1TSU9GMV9TUzFfRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3J4X2RfcGluc1tdID0geworCS8qIFJYRCAqLworCVJDQVJfR1BfUElOKDAsIDI3KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9kX211eFtdID0geworCU1TSU9GMV9SWERfRF9NQVJLLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YxX3R4X2RfcGluc1tdID0geworCS8qIFRYRCAqLworCVJDQVJfR1BfUElOKDAsIDI2KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV90eF9kX211eFtdID0geworCU1TSU9GMV9UWERfRF9NQVJLLAorfTsKKworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfY2xrX2VfcGluc1tdID0geworCS8qIFNDSyAqLworCVJDQVJfR1BfUElOKDUsIDE4KSwKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9jbGtfZV9tdXhbXSA9IHsKKwlNU0lPRjFfU0NLX0VfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9zeW5jX2VfcGluc1tdID0geworCS8qIFNZTkMgKi8KKwlSQ0FSX0dQX1BJTig1LCAxOSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfc3luY19lX211eFtdID0geworCU1TSU9GMV9TWU5DX0VfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMV9yeF9lX3BpbnNbXSA9IHsKKwkvKiBSWEQgKi8KKwlSQ0FSX0dQX1BJTig1LCAxNyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjFfcnhfZV9tdXhbXSA9IHsKKwlNU0lPRjFfUlhEX0VfTUFSSywKK307CitzdGF0a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K307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zczFfYl9tdXhbXSA9IHsKKwlNU0lPRjJfU1MxX0JfTUFSSywKK307CitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9zczJfYl9waW5zW10gPSB7CisJLyogU1MyICovCisJUkNBUl9HUF9QSU4oMywgOSksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3MyX2JfbXV4W10gPSB7CisJTVNJT0YyX1NTMl9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfcnhfYl9waW5zW10gPSB7CisJLyogUlhEICovCisJUkNBUl9HUF9QSU4oMywgMTcpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3J4X2JfbXV4W10gPSB7CisJTVNJT0YyX1JYRF9CX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfdHhfYl9waW5zW10gPSB7CisJLyogVFhEICovCisJUkNBUl9HUF9QSU4oMywgMTYpLAorfTsKK3N0YXRpYyBjb25zdCB1bnNpZ25lZCBpbnQgbXNpb2YyX3R4X2JfbXV4W10gPSB7CisJTVNJT0YyX1RYRF9CX01BUkssCit9OworCitzdGF0aWMgY29uc3QgdW5zaWduZWQgaW50IG1zaW9mMl9jbGtfY19waW5zW10gPSB7CisJLyogU0NLICovCisJUkNBUl9HUF9QSU4oMiwgMiksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfY2xrX2NfbXV4W10gPSB7CisJTVNJT0YyX1NDS19DX01BUkssCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZjJfc3luY19jX3BpbnNbXSA9IHsKKwkvKiBTWU5DICovCisJUkNBUl9HUF9QSU4oMiwgMyksCit9Oworc3RhdGljIGNvbnN0IHVuc2lnbmVkIGludCBtc2lvZ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pbmRlcl91aW50cHRyX3QJYnVmZmVyOworCQkJLyogb2Zmc2V0cyBmcm9tIGJ1ZmZlciB0byBmbGF0X2JpbmRlcl9vYmplY3Qgc3RydWN0cyAqLworCQkJYmluZGVyX3VpbnRwdHJfdAlvZmZzZXRzOworCQl9IHB0cjsKKwkJX191OAlidWZbOF07CisJfSBkYXRhOworfTsKKworc3RydWN0IGJpbmRlcl9wdHJfY29va2llIHsKKwliaW5kZXJfdWludHB0cl90IHB0cjsKKwliaW5kZXJfdWludHB0cl90IGNvb2tpZTsKK307CisKK3N0cnVjdCBiaW5kZXJfaGFuZGxlX2Nvb2tpZSB7CisJX191MzIgaGFuZGxlOworCWJpbmRlcl91aW50cHRyX3QgY29va2llOworfSBfX2F0dHJpYnV0ZV9fKChwYWNrZWQpKTsKKworc3RydWN0IGJpbmRlcl9wcmlfZGVzYyB7CisJX19zMzIgcHJpb3JpdHk7CisJX191MzIgZGVzYzsKK307CisKK3N0cnVjdCBiaW5kZXJfcHJpX3B0cl9jb29raWUgeworCV9fczMyIHByaW9yaXR5OworCWJpbmRlcl91aW50cHRyX3QgcHRyOworCWJpbmRlcl91aW50cHRyX3QgY29va2llOworfTsKKworZW51bSBiaW5kZXJfZHJpdmVyX3JldHVybl9wcm90b2NvbCB7CisJQlJfRVJST1IgPSBfSU9SKCdyJywgMCwgX19zMzIpLAorCS8qCisJICogaW50OiBlcnJvciBjb2RlCisJICovCisKKwlCUl9PSyA9IF9JTygncicsIDEpLAorCS8qIE5vIHBhcmFtZXRlcnMhICovCisKKwlCUl9UUkFOU0FDVElPTiA9IF9JT1IoJ3InLCAyLCBzdHJ1Y3QgYmluZGVyX3RyYW5zYWN0aW9uX2RhdGEpLAorCUJSX1JFUExZID0gX0lPUigncicsIDMsIHN0cnVjdCBiaW5kZXJfdHJhbnNhY3Rpb25fZGF0YSksCisJLyoKKwkgKiBiaW5kZXJfdHJhbnNhY3Rpb25fZGF0YTogdGhlIHJlY2VpdmVkIGNvbW1hbmQuCis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aWYgKERldmljZUlvQ29udHJvbChhSGFuZDE0MDFbaGFuZF0sKHVuc2lnbmVkIGludClVMTRfU0VUVFJBTlNGRVIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRkLHNpemVvZihUUkFOU0ZFUkRFU0MpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0ZCxzaXplb2Yoc3RydWN0IHRyYW5zZmVyX2FyZWFfZGVzYyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJXb3JrLHNpemVvZihQQVJBTUJMSyksJmR3Qnl0ZXMsTlVMTCkpCiAgICAgICAgIHsKICAgICAgICAgICAgIGlmIChkd0J5dGVzID49IHNpemVvZihQQVJBTUJMSykpICAgIC8vIG1heWJlIGVycm9yIGZyb20gZHJpdmVyPwpAQCAtMjQ5NiwxNCArMjQ5NiwxNCBAQAogICAgIHsKICAgICAgICAgUEFSQU1CTEsgcldvcms7CiAgICAgICAgIHVuc2lnbmVkIGludCBkd0J5dGVzOwotICAgICAgICBUUkFOU0ZFUkRFU0MgdHhEZXNjOworICAgICAgICBzdHJ1Y3QgdHJhbnNmZXJfYXJlYV9kZXNjIHR4RGVzYzsKICAgICAgICAgdHhEZXNjLndBcmVhID0gd0FyZWE7ICAgICAgICAgICAgIC8qIFB1cmUgTlQgLSBwdXQgZGF0YSBpbnRvIHN0cnVjdCAqLwogICAgICAgICB0eERlc2MubHB2QnVmZiA9IHB2QnVmZjsKICAgICAgICAgdHhEZXNjLmR3TGVuZ3RoID0gZHdMZW5ndGg7CiAgICAgICAgIHR4RGVzYy5lU2l6ZSA9IChzaG9ydCliVG9Ib3N0OyAgICAgICAvKiBVc2UgdGhpcyBmb3IgZGlyZWN0aW9uIGZsYWcgKi8KICAgIAogICAgICAgICBpZiAoRGV2aWNlSW9Db250cm9sKGFIYW5kMTQwMVtoYW5kXSwodW5zaWduZWQgaW50KVUxNF9TRVRDSVJDVUxBUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0eER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ICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLworICogQ29weXJpZ2h0IChDKSAyMDA0LDIwMDUgIEFEREktREFUQSBHbWJIIGZvciB0aGUgc291cmNlIGNvZGUgb2YgdGhpcyBtb2R1bGUuCisgKgorICoJQURESS1EQVRBIEdtYkgKKyAqCURpZXNlbHN0cmFzc2UgMworICoJRC03NzgzMyBPdHRlcnN3ZWllcgorICoJVGV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25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gICAgICAgICAgICA6IDAgQ29uZmlndXJlIEFzIFRpbWVyICAgICAgfAotfAkJCQkJCQkJCQkgICAxIENvbmZpZ3VyZSBBcyBXYXRjaGRvZyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IFdhdGNoZG9nIG51bWJlcgotfAkJCQkJICBkYXRhWzJdICAgICAgICAgICAgOiBUaW1lIGJhc2UgVW5pdCAgICAgICAgICAgIHwKLXwJCQkJCSAgZGF0YVszXQkJCSA6IFJlbG9hZCBWYWx1ZQkJCSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSAgICAgICAgICAgIDogRXh0ZXJuYWwgVHJpZ2dlciAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOkVuYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDpEaXNhYmxlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs1XSAgICAgICAgICAgIDpFeHRlcm5hbCBUcmlnZ2VyIExldmVsCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMCBUcmlnZ2VyIERpc2FibGVkCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwMSBUcmlnZ2VyIEVuYWJsZWQgKExvdyBsZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwIFRyaWdnZXIgRW5hYmxlZCAoSGlnaCBMZXZlbCkKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExIFRyaWdnZXIgRW5hYmxlZCAoSGlnaC9Mb3cgbGV2ZWwpCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs2XSAgICAgICAgICAgIDogRXh0ZXJuYWwgR2F0ZSAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOkVuYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA6RGlzYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbN10gICAgICAgICAgICA6IEV4dGVybmFsIEdhdGUgbGV2ZWwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAwIEdhdGUgRGlzYWJsZWQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAxIEdhdGUgRW5hYmxlZCAoTG93IGxldmVsKQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAgR2F0ZSBFbmFibGVkIChIaWdoIExldmVsKQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbOF0gICAgICAgICAgICA6V2FybmluZyBSZWxheQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwOiBESVNBQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs5XSAgICAgICAgICAgIDpXYXJuaW5nIERlbGF5IGF2YWlsYWJsZQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMTBdICAgICAgICAgICA6V2FybmluZyBSZWxheSBUaW1lIHVuaXQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzExXSAgICAgICAgICAgOldhcm5pbmcgUmVsYXkgVGltZSBSZWxvYWQgdmFsdWUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzEyXSAgICAgICAgICAgOlJlc2V0IFJlbGF5Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogRElTQUJMRQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMTNdICAgICAgICAgICA6SW50ZXJydXB0Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIDogRU5BQkxFCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIDogRElTQUJMRQotfAotfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBSZXR1cm4gVmFsdWUgICAgICA6IFRSVUUgIDogTm8gZXJyb3Igb2NjdXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICA6IEZBTFNFIDogRXJyb3Igb2NjdXIuIFJldHVybiB0aGUgZXJyb3IgICAgICAgICAgfAotfAkJCSAgICAgICAgICAgICA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yogU2V0IHRoZSBtb2RlIDogICAgICAgICAgICAgKi8KIAkJLyogLSBEaXNhYmxlIHRoZSBoYXJkd2FyZSAgICAgKi8KIAkJLyogLSBEaXNhYmxlIHRoZSBjb3VudGVyIG1vZGUgKi8KQEAgLTIwNiwxMDEgKzE1MSw4MiBAQAogCQkvKiAtIERpc2FibGUgdGhlIHJlc2V0ICAgICAgICAqLwogCQkvKiAtIEVuYWJsZSB0aGUgdGltZXIgbW9kZSAgICAqLwogCQkvKiAtIFNldCB0aGUgdGltZXIgbW9kZSAgICAgICAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQl1aV9Db21tYW5kID0KIAkJCSh1aV9Db21tYW5kICYgMHhGRkY3MTlFMlVMKSB8IHVpX01vZGUgPDwgMTNVTCB8IDB4MTBVTDsKIAotCX0JCQkvKiBpZiAoZGF0YVswXSA9PSBBRERJREFUQV9USU1FUikgKi8KLQllbHNlIHsKLQkJaWYgKGRhdGFbMF0gPT0gQURESURBVEFfV0FUQ0hET0cpIHsKKwl9IGVsc2UgaWYgKGRhdGFbMF0gPT0gQURESURBVEFfV0FUQ0hET0cpIHsKIAotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCS8qIFNldCB0aGUgbW9kZSA6ICAgICAgICAgICAgICovCi0JCQkvKiAtIERpc2FibGUgdGhlIGhhcmR3YXJlICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSBjb3VudGVyIG1vZGUgKi8KLQkJCS8qIC0gRGlzYWJsZSB0aGUgd2FybmluZyAgICAgICovCi0JCQkvKiAtIERpc2FibGUgdGhlIHJlc2V0ICAgICAgICAqLwotCQkJLyogLSBEaXNhYmxlIHRoZSB0aW1lciBtb2RlICAgKi8KLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJCS8qIFNldCB0aGUgbW9kZSA6ICAgICAgICAgICAgICovCisJCS8qIC0gRGlzYWJsZSB0aGUgaGFyZHd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GODlGVUw7CiAJaWYgKGRhdGFbNF0gPT0gQURESURBVEFfRU5BQkxFKSB7Ci0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKIAkJLyogU2V0IHRoZSBoYXJkd2FyZSB0cmlnZ2VyIGxldmVsICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kIHwgKGRhdGFbNV0gPDwgNSk7CiAJfQogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0JdWlfQ29tbWFuZCA9IDA7CisKIAl1aV9Db21tYW5kID0gaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgZ2F0ZSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgZ2F0ZSAqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjg3RlVMOwogCWlmIChkYXRhWzZdID09IEFERElEQVRBX0VOQUJMRSkgewotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBTZXQgdGhlIGhhcmR3YXJlIGdhdGUgbGV2ZWwgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJCS8qIFNldCB0aGUgaGFyZHdhcmUgZ2F0ZSBsZXZlbCAqLwogCQl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzddIDw8IDcpOwogCX0KIAlvdXRsKHVpX0NvbW1hbmQsIGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCXVpX0NvbW1hbmQgPSAwOworCiAJdWlfQ29tbWFuZCA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRGlzYWJsZSB0aGUgaGFyZHdhcmUgb3V0cHV0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCS8qIERpc2FibGUgdGhlIGhhcmR3YXJlIG91dHB1dCAqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjlGQlVMOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFNldCB0aGUgaGFyZHdhcmUgb3V0cHV0IGxldmVsICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJLyogU2V0IHRoZSBoYXJkd2FyZSBvdXRwdXQgbGV2ZWwgKi8KIAl1aV9Db21tYW5kID0gdWlfQ29tbWFuZCB8IChkYXRhWzhdIDw8IDIpOwogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7CiAJaWYgKGRhdGFbOV0gPT0gQURESURBVEFfRU5BQkxFKSB7Ci0gICAvKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJCS8qIFNldCB0aGUgcmVsb2FkIHZhbHVlICovCi0gICAvKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRsKGRhdGFbMTFdLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAyNCk7Ci0gICAvKioqKioqKioqKioqKioqKioqKioqKi8KKwogCQkvKiBTZXQgdGhlIHRpbWUgdW5pdGUgKi8KLSAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRsKGRhdGFbMTBdLAogCQkJZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAyOCk7CiAJfQogCi0JdWlfQ29tbWFuZCA9IDA7CiAJdWlfQ29tbWFuZCA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogCS8qIERpc2FibGUgdGhlIGhhcmR3YXJlIG91dHB1dCAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kICYgMHhGRkZGRjlGN1VMOwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwogCS8qIFNldCB0aGUgaGFyZHdhcmUgb3V0cHV0IGxldmVsICovCi0gICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0NvbW1hbmQgPSB1aV9Db21tYW5kIHwgKGRhdGFbMTJdIDw8IDMpOwogCW91dGwodWlfQ29tbWFuZCwgZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gLyoqICBFbmFibGUgdGhlIHdhdGNoZG9nIGludGVycnVwdCAgKiovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JdWlfQ29tbWFuZCA9IDA7CisKKwkvKiBFbmFibGUgdGhlIHdhdGNoZG9nIGludGVycnVwdCAqLwogCXVpX0NvbW1hbmQgPSBpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxMik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFNldCB0aGUgaW50ZXJydXB0IHNlbGVjdGlvbiAqLwotL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iBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwJCQkJCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gOiAwIC0gU3RvcCBTZWxlY3RlZCBUaW1lci9XYXRjaGRvZyAgICAgfAotfAkJCQkJICAgICAgICAgICAgMSAtIFN0YXJ0IFNlbGVjdGVkIFRpbWVyL1dhdGNoZG9nICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDIgLSBUcmlnZ2VyIFNlbGVjdGVkIFRpbWVyL1dhdGNoZG9nICB8Ci18CQkJCQkgICAgICAgICAgICAzIC0gU3RvcCBBbGwgVGltZXIvV2F0Y2hkb2cgICAgICAgICAgfAotfAkJCQkJICAgICAgICAgICAgNCAtIFN0YXJ0IEFsbCBUaW1lci9XYXRjaGRvZyAgICAgICAgIHwKLXwJCQkJCSAgICAgICAgICAgIDUgLSBUcmlnZ2VyIEFsbCBUaW1lci9XYXRjaGRvZyAgICAgICB8Ci18CQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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W1lcl93cml0ZShzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAorCQkJICAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbiwKKwkJCSAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEpCiB7CiAJc3RydWN0IGFkZGlfcHJpdmF0ZSAqZGV2cHJpdiA9IGRldi0+cHJpdmF0ZTsKLQl1bnNpZ25lZCBpbnQgdWlfQ29tbWFuZCA9IDA7Ci0JaW50IGlfQ291bnQgPSAwOworCXVuc2lnbmVkIGludCB1aV9Db21tYW5kOworCWludCBpX0NvdW50OwogCiAJaWYgKGRhdGFbMF0gPT0gMSkgewogCQl1aV9Db21tYW5kID0KIAkJCWlubChkZXZwcml2LT5pb2Jhc2UgKyAoKGlfV2F0Y2hkb2dOYnIgLSAxKSAqIDMyKSArIDEyKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKiovCisKIAkJLyogU3RhcnQgdGhlIGhhcmR3YXJlICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQl1aV9Db21tYW5kID0gKHVpX0NvbW1hbmQgJiAweEZGRkZGOUZGVUwpIHwgMHgxVUw7CiAJCW91dGwodWlfQ29tbWFuZCwKIAkJCWRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCX0JCQkvKiAgaWYgIChkYXRhWzBdPT0xKSAqLworCX0KIAlpZiAoZGF0YVswXSA9PSAyKSB7CiAJCXVpX0NvbW1hbmQgPQogCQkJaW5sKGRldnByaXYtPmlvYmFzZSArICgoaV9XYXRjaGRvZ05iciAtIDEpICogMzIpICsgMTIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJCS8qIFNldCB0aGUgdHJpZ2dlciBjb21tYW5kICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCXVpX0NvbW1h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NrICAgICAgICAgICAgICA6IFJlYWQgVGhlIFNlbGVjdGVkIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgCQkJCQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJZGF0YVswXSAgICAgICAgICAgIDogc29mdHdhcmUgdHJpZ2dlciBzdGF0dXMKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzCi18ICAgICAJICAJICAgICAgICBkYXRhWzJdICAgICAgICAgICAgOiBTb2Z0d2FyZSBjbGVhciBzdGF0dXMKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbM10gICAgICAgICAgICA6IE92ZXJmbG93IHN0YXR1cwotfC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KKyAqLworc3RhdGljIGludCBhcGNpMDM1X3RpbWVyX3JlYWQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JdW5zaWduZWQgaW50IHVpX1N0YXR1cyA9IDA7CS8qICBTdGF0dXMgcmVnaXN0ZXIgKi8KKwl1bnNpZ25lZCBpbnQgdWlfU3RhdHVzOwkvKiAgU3RhdHVzIHJlZ2lzdGVyICovCiAKIAlpX1dhdGNoZG9nTmJyID0gaW5zbi0+dW51c2VkWzBdOwogCi0JLyoqKioqKioqKioqKioqKioqKi8KIAkvKiBHZXQgdGhlIHN0YXR1cyAqLwotCS8qKioqKioqKioqKioqKioqKiovCi0KIAl1aV9TdGF0dXMgPSBpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChpX1dhdGNoZG9nTmJyIC0gMSkgKiAzMikgKyAxNik7CiAKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogR2V0IHRoZSBzb2Z0d2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQogCWRhdGFbMF0gPSAoKHVpX1N0YXR1cyA+PiAxKSAmIDEpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkvKiBHZXQgdGhlIGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCWRhdGFbMV0gPSAoKHVpX1N0YXR1cyA+PiAyKSAmIDEpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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gICAgICAgIDogRGF0YSBQb2ludGVyIGNvbnRhaW5zICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgICAgOiBXYXJuaW5nIGRlbGF5IHZhbHVlCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBPdXRwdXQgUGFyYW1ldGVycyA6CS0tCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgUmV0dXJuIFZhbHVlICAgICAgOiBUUlVFICA6IE5vIGVycm9yIG9jY3VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJICAgICAgICAgICAgOiBGQUxTRSA6IEVycm9yIG9jY3VyLiBSZXR1cm4gdGhlIGVycm9yICAgICAgICAgIHwKLXwJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSovCi1zdGF0aWMgaW50IGlfQVBDSTAzNV9Db25maWdBbmFsb2dJbnB1dChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCSAgICAgICBzdHJ1Y3Q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KiBkYXRhWzBdIERpZ2l0YWwgVmFsdWUgT2YgSW5wdXQKKyAqLworc3RhdGljIGludCBhcGNpMDM1X2FpX3JlYWQoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKKwkJCSAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLAorCQkJICAgdW5zaWduZWQgaW50ICpkYXRhKQogewogCXN0cnVjdCBhZGRpX3ByaXZhdGUgKmRldnByaXYgPSBkZXYtPnByaXZhdGU7Ci0JdW5zaWduZWQgaW50IHVpX0NvbW1hbmRSZWdpc3RlciA9IDA7CisJdW5zaWduZWQgaW50IHVpX0NvbW1hbmRSZWdpc3RlcjsKIAotLyoqKioqKioqKioqKioqKioqKi8KLS8qICBTZXQgdGhlIHN0YXJ0ICovCi0vKioqKioqKioqKioqKioqKioqLworCS8qICBTZXQgdGhlIHN0YXJ0ICovCiAJdWlfQ29tbWFuZFJlZ2lzdGVyID0gMHg4MDAwMDsKLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCiAJLyogV3JpdGUgdGhlIGNvbW1hbmQgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGwodWlfQ29tbWFuZFJlZ2lzdGVyLCBkZXZwcml2LT5pb2Jhc2UgKyAxMjggKyA4KTsKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFJlYWQgdGhlIGRpZ2l0YWwgdmFsdWUgb2YgdGhlIGlucHV0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCS8qIFJlYWQgdGhlIGRpZ2l0YWwgdmFsdWUgb2YgdGhlIGlucHV0ICovCiAJZGF0YVswXSA9IGlubChkZXZwcml2LT5pb2Jhc2UgKyAxMjggKyAyOCk7CiAJcmV0dXJuIGluc24tPm47CiB9CiAKLS8qCi0rLS0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gICAgICAgICAgICAgICAgICB8Ci0gICstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLSAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0gIHwgICBEYXRlICAgfCAgIEF1dGhvciAgfCAgICAgICAgICBEZXNjcmlwdGlvbiBvZiB1cGRhdGVzICAgICAgICAgICAgICAgIHwKLSAgKy0tLS0tLS0tLS0rLS0tLS0tLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotICB8ICAgICAgICAgIHwgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIHwgICAgICAgICAgfCAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgfCAgICAgICAgICB8ICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICArLS0tLS0tLS0tLSstLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotCi0vKioqKioqKioqICAgICAgRGVmaW5pdGlvbnMgZm9yIEFQQ0ktMTUwMCBjYXJkICAqKioqKi8KKyAqIENvcHlyaWdodCAoQykgMjAwNCwyMDA1ICBBRERJLURBVEEgR21iSCBmb3IgdGhlIHNvdXJjZSBjb2RlIG9mIHRoaXMgbW9kdWxlLgorICoKKyAqCU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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiA6IERyaXZlciBoYW5kbGUgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCSAgZGF0YVswXSAgICAgICAgICAgIDpOdW1iZXIgb2YgdGhlIGlucHV0IHBvcnQgb24gICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWNoIHRoZSBldmVudCB3aWxsIHRha2UgcGxhY2UgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDEgb3IgMikKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgIDogVGhlIGV2ZW50IGxvZ2ljIGZvciBwb3J0IDEgaGFzICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocmVlIHBvc3NpYmlsaXRpZXMgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6MCAgQVBDSTE1MDBfQU5EICAgICAgIDpUaGlzIGxvZ2ljICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmtzICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGlucHV0cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIGFuIEFORCB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZ2ljLiAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIEFQQ0kxNTAwX09SICAgICAgICA6VGhpcyBsb2dpYyAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rcyAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBpbnB1dHMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aCBhICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYy4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICBBUENJMTUwMF9PUl9QUklPUklUWSAgICAgICAgfAotfAkJCQkJCQkJOlRoaXMgbG9naWMgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3MgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgaW5wdXRzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHkgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYy4gICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElucHV0IDEgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzIHRoZSAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0ICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5ICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWwgYW5kICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCAgIDggICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzbWFsbGVzdHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciB0aGUgc2Vjb25kIHBvcnQgdGhlIHVzZXIgaGFzfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSBwb3NzaWJpbGl0eTogICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBUENJMTUwMF9PUiAgICAgICAgOlRoaXMgbG9naWMgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3MgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgaW5wdXRzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggYSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9sYXJpdHkgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUiBsb2dpYyAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSAgICAgICAgICAgICAgOiBUaGVzZSA4LWNoYXJhY3RlciB3b3JkIGZvciBwb3J0MXwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCA2LWNoYXJhY3RlciB3b3JkIGZvciBwb3J0IDIgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2l2ZSB0aGUgbWFzayBvZiB0aGUgZXZlbnQuICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFYWNoIHBsYWNlIGdpdmVzIHRoZSBzdGF0ZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBpbnB1dCBjaGFubmVscyBhbmQgY2FuICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGF2ZSBvbmUgb2YgdGhlc2Ugc2l4IGNoYXJhY3RlcnN8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgOiBUaGlzIGlucHV0IG11c3QgYmUgb24gMCAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICA6IFRoaXMgaW5wdXQgbXVzdCBiZSBvbiAxICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgIDogVGhpcyBpbnB1dCByZWFjdHMgdG8gICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhIGZhbGxpbmcgZWRnZSAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICA6IFRoaXMgaW5wdXQgcmVhY3RzIHRvIGEgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlzaW5nIGVkZ2UgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNCAgOiBUaGlzIGlucHV0IHJlYWN0cyB0byBib3RoIGVkZ2VzIHwKLXwKLXwJCQkJCQkJCTUgIDogVGhpcyBpbnB1dCBpcyBub3QgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VkIGZvciBldmVudCAgIAkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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WFzayBkb2VzIG5vdCBleGlzdFxuIik7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGhlIG9wdGlvbiBpbmRpY2F0ZWQgaW4gdGhlIGV2ZW50IG1hc2sgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBzd2l0Y2goaV9FdmVudE1hc2spICovCiAJfQkJCS8qIGZvciAoaV9Db3VudCA9IGlfTWF4Q2hhbm5lbDsgaV9Db3VudCA+MDtpX0NvdW50IC0tKSAqLwogCiAJaWYgKGRhdGFbMF0gPT0gMSkgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIGludGVycnVwdCBsb2dpYyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKGRhdGFbMV0gPT0gQVBDSTE1MDBfQU5EIHx8CiAJCQlkYXRhWzFdID09IEFQQ0kxNTAwX09SIHx8CiAJCQlkYXRhWzFdID09IEFQQ0kxNTAwX09SX1BSSU9SSVRZKSB7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBUZXN0cyBpZiBhIHRyYW5zaXRpb24gd2FzIGRlY2xhcmVkICovCiAJCQkvKiBmb3IgYSBPUiBQUklPUklUWSBsb2dpYyAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCWlmIChkYXRhWzFdID09IEFQQ0kxNTAwX09SX1BSSU9SSVRZCiAJCQkJJiYgaV9QYXR0ZXJuVHJhbnNpdGlvbiAhPSAwKSB7Ci0JCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0JCQkJLyogVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBPUiBQUklPUklUWSBsb2dpYyAqLwotCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCQkJCXByaW50aygiXG5UcmFuc2l0aW9uIGVycm9yIG9uIGFuIE9SIFBSSU9SSVRZIGxvZ2ljXG4iKTsKKwkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJIlRyYW5zaXRpb24gZXJyb3Igb24gYW4gT1IgUFJJT1JJVFkgbG9naWNcbiIpOwogCQkJCXJldHVybiAtRUlOVkFMOwogCQkJfQkvKiAgaWYgKGRhdGFbMV09PSBBUENJMTUwMF9PUl9QUklPUklUWSAmJiBpX1BhdHRlcm5UcmFuc2l0aW9uICE9IDApICovCiAKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdHMgaWYgbW9yZSB0aGFuIG9uZSB0cmFuc2l0aW9uICovCiAJCQkvKiB3YXMgZGVjbGFyZWQgZm9yIGFuIEFORCBsb2dpYyAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpZiAoZGF0YVsxXSA9PSBBUENJMTUwMF9BTkQpIHsKIAkJCQlmb3IgKGlfQ291bnQgPSAwOyBpX0NvdW50IDwgODsgaV9Db3VudCsrKSB7CkBAIC0zNjAsMjkgKzI3NCwyMSBAQAogCQkJCX0JLyogZm9yIChpX0NvdW50ID0gMDsgaV9Db3VudCA8IDg7IGlfQ291bnQrKykgKi8KIAogCQkJCWlmIChpX1BhdHRlcm5UcmFuc2l0aW9uQ291bnQgPiAxKSB7Ci0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJLyogVHJhbnNpdGlvbiBlcnJvciBvbiBhbiBBTkQgbG9naWMgICAgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQkJCQkJcHJpbnRrKCJcbiBUcmFuc2l0aW9uIGVycm9yIG9uIGFuIEFORCBsb2dpY1xuIik7CisJCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkJIlRyYW5zaXRpb24gZXJyb3Igb24gYW4gQU5EIGxvZ2ljXG4iKTsKIAkJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQkJfQkvKiAgaWYgKGlfUGF0dGVyblRyYW5zaXRpb25Db3VudCA+IDEpICovCiAJCQl9CS8qICBpZiAoZGF0YVsxXT09IEFQQ0kxNTAwX0FORCkgKi8KIAotCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEaXNhYmxlIFBvcnQgQSAqLwotCQkJICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKDB4RjAsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCAxICAgICovCi0JCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9QQVRURVJOX1BPTEFSSVRZLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0zOTAsMjAgKzI5NiwxNiBAQAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIG1hc2sgcmVnaXN0ZXIgb2YgICAgICAqLwogCQkJLyogcG9ydCAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfUEFUVEVSTl9NQVNLLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQlvdXRiKGlfUGF0dGVybk1hc2ssCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIHBhdHRlcm4gdHJhbnNpdGlvbiByZWdpc3RlciAgKi8KIAkJCS8qIG9mIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9QQVRURVJOX1RSQU5TSVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQxMSwxMCArMzEzLDggQEAKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gbWFzayAgICAqLwogCQkJLyogcmVnaXN0ZXIgb2YgcG9ydCAxICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9BX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQyMiwxNyArMzIyLDEzIEBACiAJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IDEgICAgICAgICAgICAgICAgICAgICAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogUG9ydCBBIG5ldyBtb2RlICAgICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweEY5KSB8IGRhdGFbMV0gfCAweDk7CiAJCQlvdXRiKGlfUmVnVmFsdWUsCkBAIC00NDEsNTMgKzMzNyw0MCBAQAogCiAJCQlpX0V2ZW50MVN0YXR1cyA9IDE7CiAKLQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkvKiBFbmFibGUgUG9ydCBBICovCi0JCQkgIC8qKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoMHhGNCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCX0JCS8qICBpZihkYXRhWzFdPT1BUENJMTUwMF9BTkR8fGRhdGFbMV09PUFQQ0kxNTAwX09SfHxkYXRhWzFdPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAkJZWxzZSB7Ci0JCQlwcmludGsoIlxuVGhlIGNob2ljZSBmb3IgaW50ZXJydXB0IGxvZ2ljIGRvZXMgbm90IGV4aXN0XG4iKTsKKwkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCSJUaGUgY2hvaWNlIGZvciBpbnRlcnJ1cHQgbG9naWMgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBlbHNlIH0vLyBpZihkYXRhWzFdPT1BUENJMTUwMF9BTkR8fGRhdGFbMV09PUFQQ0kxNTAwX09SfHxkYXRhWzFdPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAl9CQkJLyogICAgaWYgKGRhdGFbMF09PSAxKSAqLwogCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFRlc3QgaWYgZXZlbnQgc2V0dGluZyBmb3IgcG9ydCAyICovCi0JCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJaWYgKGRhdGFbMF0gPT0gMikgewotCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogVGVzdCB0aGUgZXZlbnQgbG9naWMgKi8KLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJaWYgKGRhdGFbMV0gPT0gQVBDSTE1MDBfT1IpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERpc2FibGUgUG9ydCBCICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YigweDc0LAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAqLwogCQkJLyogcmVnaXN0ZXIgb2YgcG9ydCBCICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTQ5NSwxMCArMzc4LDggQEAKIAkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiBtYXNrICAgICovCiAJCQkvKiByZWdpc3RlciBvZiBwb3J0IEIgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1NQRUNJRklDQVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTUwNywzNyArMzg4LDI5IEBACiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIGVycm9yIGNoYW5uZWxzIDEgYW5kIDIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQlpX1BhdHRlcm5NYXNrID0gKGlfUGF0dGVybk1hc2sgfCAweEMwKTsKIAkJCWlfUGF0dGVyblBvbGFyaXR5ID0gKGlfUGF0dGVyblBvbGFyaXR5IHwgMHhDMCk7CiAJCQlpX1BhdHRlcm5UcmFuc2l0aW9uID0gKGlfUGF0dGVyblRyYW5zaXRpb24gfCAweEMwKTsKIAotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwb2xhcml0eSByZWdpc3RlciBvZiBwb3J0IDIgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfUEFUVEVSTl9QT0xBUklUWSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJb3V0YihpX1BhdHRlcm5Qb2xhcml0eSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHRyYW5zaXRpb24gcmVnaXN0ZXIgICAgKi8KIAkJCS8qIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX1RSQU5TSVRJT04sCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCW91dGIoaV9QYXR0ZXJuVHJhbnNpdGlvbiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIE1hc2sgcmVnaXN0ZXIgICAgKi8KIAkJCS8qIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1BBVFRFUk5fTUFTSywKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwpAQCAtNTQ2LDIwICs0MTksMTYgQEAKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIG1hc2sgICAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJaV9SZWdWYWx1ZSA9CiAJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIG1hc2sgICAgKi8KIAkJCS8qIHJlZ2lzdGVyIG9mIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtNTY5LDIzICs0MzgsMjAgQEAKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAogCQkJaV9FdmVudDJTdGF0dXMgPSAxOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICA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CQkgIChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLCAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9pbnNuICppbnNuLHVuc2lnbmVkIGludCAqZGF0YSkgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiAgQWxsb3dzIG9yIGRpc2FsbG93cyBhIHBvcnQgZXZlbnQgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgIDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICB8Ci18CQkgICAgICAgICAgICAgIHVuc2lnbmVkIGludCB1aV9DaGFubmVsIDogQ2hhbm5lbCBudW1iZXIgdG8gcmVhZCAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50ICpkYXRhICAgICAgICAgIDogRGF0YSBQb2ludGVyIHRvIHJlYWQgc3RhdHVzICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIGRhdGFbMF0gICAgICAgICAgICAgICAgIDowIFN0YXJ0IGlucHV0IGV2ZW50Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxIFN0b3AgaW5wdXQgZXZlbnQKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgICAgICAgOk5vIG9mIHBvcnQgKDEgb3Ig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TAwX2RpX3dyaXRlKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCisJCQkgICAgIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAorCQkJICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCisJCQkgICAgIHVuc2lnbmVkIGludCAqZGF0YSkKIHsKIAlzdHJ1Y3QgYWRkaV9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwogCWludCBpX0V2ZW50MUludGVycnVwdFN0YXR1cyA9IDAsIGlfRXZlbnQySW50ZXJydXB0U3RhdHVzID0KQEAgLTYyNiw0OCArNDc2LDMwIEBACiAKIAlzd2l0Y2ggKGRhdGFbMF0pIHsKIAljYXNlIFNUQVJUOgotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBUZXN0cyB0aGUgcG9ydCBudW1iZXIgKi8KLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQlpZiAoZGF0YVsxXSA9PSAxIHx8IGRhdGFbMV0gPT0gMikgewotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBUZXN0IGlmIHBvcnQgMSBzZWxlY3RlZCAqLwotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCWlmIChkYXRhWzFdID09IDEpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUZXN0IGlmIGV2ZW50IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJaWYgKGlfRXZlbnQxU3RhdHVzID09IDEpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEFsbG93cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhDMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBFbmFibGUgUG9ydCBBICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGNCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTY4MCwxODUgKzUxMiwxNDIgQEAKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RDAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKIAkJCQl9CS8qICBpZihpX0V2ZW50MVN0YXR1cz09MSkgKi8KIAkJCQllbHNlIHsKLQkJCQkJcHJpbnRrKCJcbkV2ZW50IDEgbm90IGluaXRpYWxpc2VkXG4iKTsKKwkJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCQkiRXZlbnQgMSBub3QgaW5pdGlhbGlzZWRcbiIpOwogCQkJCQlyZXR1cm4gLUVJTlZBTDsKIAkJCQl9CS8qIGVsc2UgaWYoaV9FdmVudDFTdGF0dXM9PTEpICovCiAJCQl9CS8qIGlmIChkYXRhWzFdPT0xKSAqLwogCQkJaWYgKGRhdGFbMV0gPT0gMikgewogCiAJCQkJaWYgKGlfRXZlbnQyU3RhdHVzID09IDEpIHsKLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBEaXNhYmxlIFBvcnQgQiAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweDc0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mICAgICAgKi8KIAkJCQkJLyogcG9ydCAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogQWxsb3dzIHRoZSBwYXR0ZXJuIGludGVycnVwdCAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEMwLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEVuYWJsZSBQb3J0IEIgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEY0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCiAJCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBpbnRlcnJ1cHQgY29udHJvbCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4RDAsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVB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CWlmIChkYXRhWzFdID09IDEpIHsKLQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUZXN0IGlmIGV2ZW50IGluaXRpYWxpc2VkICovCi0JCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJaWYgKGlfRXZlbnQxU3RhdHVzID09IDEpIHsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhGMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEluaGliaXRzIHRoZSBwYXR0ZXJuIGludGVycnVwdCAgICAgICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEUwLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBTZWxlY3RzIHRoZSBBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MIHJlZ2lzdGVyICovCi0JCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgICAgICAvKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIEVuYWJsZSBQb3J0IEEgKi8KLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YigweEY0LAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJCQlpX0V2ZW50MUludGVycnVwdFN0YXR1cyA9IDA7CiAJCQkJfQkvKiAgaWYoaV9FdmVudDFTdGF0dXM9PTEpICovCiAJCQkJZWxzZSB7Ci0JCQkJCXByaW50aygiXG5FdmVudCAxIG5vdCBpbml0aWFsaXNlZFxuIik7CisJCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkJIkV2ZW50IDEgbm90IGluaXRpYWxpc2VkXG4iKTsKIAkJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQkJfQkvKiBlbHNlIGlmKGlfRXZlbnQxU3RhdHVzPT0xKSAqLwogCQkJfQkvKiBpZiAoZGF0YVsxXT09MSkgKi8KIAkJCWlmIChkYXRhWzFdID09IDIpIHsKLQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBldmVudCBpbml0aWFsaXNlZCAqLwotCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlpZiAoaV9FdmVudDJTdGF0dXMgPT0gMSkgewotCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wgcmVnaXN0ZXIgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBEaXNhYmxlIFBvcnQgQiAqLwotCQkJICAvKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4NzQsCiAJCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiAgICAgICovCiAJCQkJCS8qIHBvcnQgMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfQ09NTUFORF9BTkRfU1RBVFVTLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQkvKiBJbmhpYml0cyB0aGUgcGF0dGVybiBpbnRlcnJ1cHQgICAgICAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCW91dGIoMHhFMCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCByZWdpc3RlciAqLwotCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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gdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKDB4RjQsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIG1vZGUgc3BlY2lmaWNhdGlvbiByZWdpc3RlciBvZiBwb3J0IEEgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfU1BFQ0lGSUNBVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweDEwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTk0Myw5ICs3MTAsNyBAQAogCS8qIERlbGV0ZXMgdGhlIHJlZ2lzdGVyICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbW9kZSBzcGVjaWZpY2F0aW9uIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweDEwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTk3NSw5ICs3NDAsNyBAQAogCS8qIERlbGV0ZXMgdGhlIHJlZ2lzdGVyICovCiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBkYXRhIHBhdGggcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCBDICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9DX0RBVEFfUENJVENIX1BPTEFSSVRZLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkvKiBIaWdoIGxldmVsIG9mIHBvcnQgQyBtZWFucyAxICovCkBAIC05OTIsOSArNzU1LDcgQEAKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBpdCAqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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iAJLyogRGVhY3RpdmF0ZXMgVGltZXIgMiBpbnRlcnJ1cHQgbWFuYWdlbWVudDogICAgICAgICAgICAgICAqLwogCW91dGIoMHhFMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBJUCBhbmQgSVVTICovCkBAIC0xMDI4LDkgKzc4NSw3IEBACiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlYWN0aXZhdGVzIGludGVycnVwdCBtYW5hZ2VtZW50IG9mIHRpbWVyIDM6ICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYt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GVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywgICA6cG9pbnRlciB0byBzdWJkZXZpY2Ugc3RydWN0dXJlCi18ICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMF0gIDoxOk1lbW9yeSBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICAgICAgICAgICAgMDpNZW1vcnkgb2ZmICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICA6MSBFbmFibGUgdGhlIHZvbHRhZ2UgZXJyb3IgaW50ZXJydXB0Ci18CQkJCQkJCSAgIDowIERpc2FibGUgdGhlIHZvbHRhZ2UgZXJyb3IgaW50ZXJydXB0IAkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCQkJCQkJCQkJCQkJCSB8Ci0rLS0tLS0tLS0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gICAgICAgICAgICAgICAgICAgKmRldixzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcyxzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKXwKLXwJCQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBDb25maWd1cmVzIFRoZSBXYXRjaGRvZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgIDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgIDogMiAgICAgQVBDSTE1MDBfMV84X0tIWgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBBUENJMTUwMF8zXzZfS0haICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgIEFQQ0kxNTAwXzExNV9LSFoKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIxL1RpbWVyMQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQ291bnRlcjIvVGltZXIyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBDb3VudGVyMy9XYXRjaGRvZwotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzJdICAgICAgICAgICAgICAgIDogMCAgICAgQ291bnRlcgotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgVGltZXIvV2F0Y2hkb2cKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVszXSAgICAgICAgICAgICAgICA6ICAgICAgICAgVGhpcyBwYXJhbWV0ZXIgaGFzICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0d28gbWVhbmluZ3MuICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIElmIHRoZSBjb3VudGVyL3RpbWVyICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgdXNlZCBhcyBhIGNvdW50ZXIgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgbGltaXQgdmFsdWUgb2YgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBjb3VudGVyIGlzIGdpdmVuICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBJZiB0aGUgY291bnRlci90aW1lciAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzIHVzZWQgYXMgYSB0aW1lciwgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGRpdmlkZXIgZmFjdG9yICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhlIG91dHB1dCBpcyAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdpdmVuLgotfCAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs0XSAgICAgICAgICAgICAgICAgOiAwICAgIEFQQ0kxNTAwX0NPTlRJTlVPVVMKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICBBUENJMTUwMF9TSU5HTEUKLXwgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbNV0gICAgICAgICAgICAgICAgIDogMCAgICBTb2Z0d2FyZSBUcmlnZ2VyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgSGFyZHdhcmUgVHJpZ2dlcgotfAotfCAgICAgICAgICAgICAgICAgICAgICAgZGF0YVs2XSAgICAgICAgICAgICAgICAgIDowICAgIFNvZnR3YXJlIGdhdGUKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICBIYXJkd2FyZSBnYXRlCi18ICAgICAgICAgICAgICAgICAgICAg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9UaW1lckNvdW50ZXJNb2RlLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9USU1FX0NTVF9MT1csCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGxvdyB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9USU1FX0NTVF9ISUdILAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgaGlnaCB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWRhdGFbM10gPSBkYXRhWzNdID4+IDg7CiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFJlYWRzIHRoZSByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gPQogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIEVuYWJsZXMgdGltZXIvY291bnRlciAxIGFuZCB0cmlnZ2VycyB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uIHwgMHg0MDsKIAotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIHJlZ2lzdGVyICovCi0JCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBjb25maWd1cmF0aW9uICovCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9NYXN0ZXJDb25maWd1cmF0aW9uLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIHJlZ2lzdGVyIG9mICAgICAqLwogCQkJCS8qIHRpbWVyL2NvdW50ZXIgMSAgICAgICAgICAgICAgICAgICAgICAqLwotCQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogRGlzYWJsZSB0aW1lci9jb3VudGVyIDEgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoMHgwLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDEgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUcmlnZ2VyIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YigweDIsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJfQkvKiBpZihkYXRhWzddPT0gQVBDSTE1MDBfRU5BQkxFIHx8ZGF0YVs3XT09IEFQQ0kxNTAwX0RJU0FCTEUpIC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7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGhpcyBjaG9pY2UgZm9yIHNvZnR3YXJlIG9yIGhhcmR3YXJlIGdhdGUgZG9lcyBub3QgZXhpc3RcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qICBzd2l0Y2goZGF0YVs2XSkgKi8KIAogCQlpX1RpbWVyQ291bnRlck1vZGUgPSBkYXRhWzJdIHwgZGF0YVs0XSB8IGRhdGFbNV0gfCBkYXRhWzZdIHwgNzsKIAotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogVGVzdCB0aGUgcmVsb2FkIHZhbHVlICovCi0JCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCWlmICgoZGF0YVszXSA+PSAwKSAmJiAoZGF0YVszXSA8PSA2NTUzNSkpIHsKIAkJCWlmIChkYXRhWzddID09IEFQQ0kxNTAwX0VOQUJMRQogCQkJCXx8IGRhdGFbN10gPT0gQVBDSTE1MDBfRElTQUJMRSkgewogCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtb2RlIHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9NT0RFX1NQRUNJRklDQVRJT04sCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBtb2RlICovCi0JCQkJLyoqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9UaW1lckNvdW50ZXJNb2RlLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9USU1FX0NTVF9MT1csCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGxvdyB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbnN0YW50IHJlZ2lzdGVyIG9mIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9USU1FX0NTVF9ISUdILAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFdyaXRlcyB0aGUgaGlnaCB2YWx1ZSAgKi8KLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWRhdGFbM10gPSBkYXRhWzNdID4+IDg7CiAJCQkJb3V0YihkYXRhWzNdLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFJlYWRzIHRoZSByZWdpc3RlciAqLwotCQkJCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX01hc3RlckNvbmZpZ3VyYXRpb24gPQogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIEVuYWJsZXMgdGltZXIvY291bnRlciAyIGFuZCB0cmlnZ2VycyB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uIHwgMHgyMDsKIAotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIG1hc3RlciBjb25maWd1cmF0aW9uIHJlZ2lzdGVyICovCi0JCQkJICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19NQVNURVJfQ09ORklHVVJBVElPTl9DT05UUk9MLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIG5ldyBjb25maWd1cmF0aW9uICovCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoaV9NYXN0ZXJDb25maWd1cmF0aW9uLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIHJlZ2lzdGVyIG9mICAgICAqLwogCQkJCS8qIHRpbWVyL2NvdW50ZXIgMiAgICAgICAgICAgICAgICAgICAgICAqLwotCQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogRGlzYWJsZSB0aW1lci9jb3VudGVyIDIgKi8KLQkJCQkgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoMHgwLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyByZWdpc3RlciBvZiAgICAgKi8KIAkJCQkvKiB0aW1lci9jb3VudGVyIDIgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBUcmlnZ2VyIHRpbWVyL2NvdW50ZXIgMSAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YigweDIsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJfQkvKiBpZihkYXRhWzddPT0gQVBDSTE1MDBfRU5BQkxFIHx8ZGF0YVs3XT09IEFQQ0kxNTAwX0RJU0FCTEUpICovCiAJCQllbHNlIHsKL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KioqKioqLwogCQkJLyogLSBFbmFibGVzIHRoZSBvdXRwdXQgbGluZSAqLwogCQkJLyogLSBFbmFibGVzIHJldHJpZ2dlciAgICAgICAqLwogCQkJLyogLSBQdWxzZXMgb3V0cHV0ICAgICAgICAgICAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlpX1RpbWVyQ291bnRlck1vZGUgPSBkYXRhWzJdIHwgZGF0YVs0XSB8IDB4NTQ7CiAJCX0JCS8qIGlmIChkYXRhWzJdID09IEFQQ0kxNTAwX1dBVENIRE9HKSAqLwogCQllbHNlIHsKIAkJCWlfVGltZXJDb3VudGVyTW9kZSA9IGRhdGFbMl0gfCBkYXRhWzRdIHwgZGF0YVs2XSB8IDc7CiAJCX0JCS8qIGVsc2VpZiAoZGF0YVsyXSA9PSBBUENJMTUwMF9XQVRDSERPRykgKi8KLQkJCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFRlc3QgdGhlIHJlbG9hZCB2YWx1ZSAqLwotCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQlpZiAoKGRhdGFbM10gPj0gMCkgJiYgKGRhdGFbM10gPD0gNjU1MzUpKSB7CiAJCQlpZiAoZGF0YVs3XSA9PSBBUENJMTUwMF9FTkFCTEUKIAkJCQl8fCBkYXRhWzddID09IEFQQ0kxNTAwX0RJU0FCTEUpIHsKIAotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbW9kZSByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfTU9ERV9TUEVDSUZJQ0FUSU9OLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgbW9kZSAqLwotCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfVGltZXJDb3VudGVyTW9kZSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfVElNRV9DU1RfTE9XLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBsb3cgdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb25zdGFudCByZWdpc3RlciBvZiB3YXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfVElNRV9DU1RfSElHSCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBXcml0ZXMgdGhlIGhpZ2ggdmFsdWUgICovCi0JCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlkYXRhWzNdID0gZGF0YVszXSA+PiA4OwogCQkJCW91dGIoZGF0YVszXSwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGNvbmZpZ3VyYXRpb24gcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9DT05GSUdVUkFUSU9OX0NPTlRST0wsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBSZWFkcyB0aGUgcmVnaXN0ZXIgKi8KLQkJCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwogCiAJCQkJaV9NYXN0ZXJDb25maWd1cmF0aW9uID0KIAkJCQkJaW5iKGRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBFbmFibGVzIHdhdGNoZG9nL2NvdW50ZXIgMyBhbmQgdHJpZ2dlcnMgd2F0Y2hkb2cvY291bnRlciAzICovCi0JCQkJICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiA9CiAJCQkJCWlfTWFzdGVyQ29uZmlndXJhdGlvbiB8IDB4MTA7CiAKLQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiByZWdpc3RlciAqLwotCQkJCSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAqLwotCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKGlfTWFzdGVyQ29uZmlndXJhdGlvbiwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogVGVzdCBpZiBDT1VOVEVSICovCi0JCQkJCSAgLyoqKioqKioqKioqKioqKioqKioqLwogCQkJCWlmIChkYXRhWzJdID09IEFQQ0kxNTAwX0NPVU5URVIpIHsKIAotCQkJCQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgcmVnaXN0ZXIgb2YgICAqLwogCQkJCQkvKiB3YXRjaGRvZy9jb3VudGVyIDMgICAgICAgICAgICAgICAgKi8KLQkJCQkJCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogRGlzYWJsZSB0aGUgIHdhdGNoZG9nL2NvdW50ZXIgMyBhbmQgc3RhcnRzIGl0ICovCi0JCQkJCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCQlvdXRiKDB4MCwKIAkJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCByZWdpc3RlciBvZiAgICovCiAJCQkJCS8qIHdhdGNoZG9nL2NvdW50ZXIgMyAgICAgICAgICAgICAgICAqLwotCQkJCQkJICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQ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8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgVGFzayAgICAgICAgICAgICAgOiBTdGFydCAvIFN0b3Agb3IgdHJpZ2dlciB0aGUgdGltZXIgY291bnRlciBvciBXYXRjaGRvZyAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IElucHV0IFBhcmFtZXRlcnMgIDogc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiAgICAgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsICAgOnBvaW50ZXIgdG8gc3ViZGV2aWNlIHN0cnVjdHVyZQotfCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24gICAgICA6cG9pbnRlciB0byBpbnNuIHN0cnVjdHVyZSAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVswXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIxL1RpbWVyMQotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgQ291bnRlcjIvVGltZXIyCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICBDb3VudGVyMy9XYXRjaGRvZwotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzFdICAgICAgICAgICAgICAgIDogMCAgICAgc3RhcnQKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIHN0b3AKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgIFRyaWdnZXIKLXwgICAgICAgICAgICAgICAgICAgICAgZGF0YVsyXSAgICAgICAgICAgICAgICA6IDAgICAgIENvdW50ZXIKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgIFRpbWVyL1dhdGNoZG9nCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTAwX1N0YXJ0U3RvcFRyaWdnZXJUaW1lckNvdW50ZXJXYXRjaGRvZyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkJCSAgIHN0cnVjdCB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QkJCWlfVGltZXJDb3VudGVyMUVuYWJsZWQgPSAxOwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMTkzOSwyMCArMTUxOCwxNyBAQAogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJCX0JLyogaWYoIGlfVGltZXJDb3VudGVyMUluaXQ9PTEpICovCiAJCQllbHNlIHsKLQkJCQlwcmludGsoIlxuQ291bnRlci9UaW1lcjEgbm90IGNvbmZpZ3VyZWRcbiIpOworCQkJCWRldl93YXJuKGRldi0+aHdfZGV2LAorCQkJCQkiQ291bnRlci9UaW1lcjEgbm90IGNvbmZpZ3VyZWRcbiIpOwogCQkJCXJldHVybiAtRUlOVkFMOwogCQkJfQogCQkJYnJlYWs7CiAKIAkJY2FzZSBTVE9QOgogCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFN0b3AgdGltZXIvY291bnRlciAxICovCi0JCQkJCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZHMgYW5kIHN0YXR1cyByZWdpc3RlciAqLwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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jJFbmFibGVkID0gMTsKLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKQEAgLTIwMjYsMjAgKzE1OTQsMTcgQEAKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCQl9CS8qIGlmKCBpX1RpbWVyQ291bnRlcjJJbml0PT0xKSAqLwogCQkJZWxzZSB7Ci0JCQkJcHJpbnRrKCJcbkNvdW50ZXIvVGltZXIyIG5vdCBjb25maWd1cmVkXG4iKTsKKwkJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkJIkNvdW50ZXIvVGltZXIyIG5vdCBjb25maWd1cmVkXG4iKTsKIAkJCQlyZXR1cm4gLUVJTlZBTDsKIAkJCX0KIAkJCWJyZWFrOwogCiAJCWNhc2UgU1RPUDoKIAotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTdG9wIHRpbWVyL2NvdW50ZXIgMiAqLwotCQkJCQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAk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fV2F0Y2hkb2dDb3VudGVyM0VuYWJsZWQgPSAxOwotCQkJCQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJCQkJCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjExMiwyMCArMTY2OSwxNyBAQAogCiAJCQl9CS8qICBpZiggaV9XYXRjaGRvZ0NvdW50ZXIzaW5pdD09MSkgKi8KIAkJCWVsc2UgewotCQkJCXByaW50aygiXG5XYXRjaGRvZy9Db3VudGVyMyBub3QgY29uZmlndXJlZFxuIik7CisJCQkJZGV2X3dhcm4oZGV2LT5od19kZXYsCisJCQkJCSJXYXRjaGRvZy9Db3VudGVyMyBub3QgY29uZmlndXJlZFxuIik7CiAJCQkJcmV0dXJuIC1FSU5WQUw7CiAJCQl9CiAJCQlicmVhazsKIAogCQljYXNlIFNUT1A6CiAKLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU3RvcCBXYXRjaGRvZy9jb3VudGVyIDMgKi8KLQkJCQkJICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCQkJCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1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AgICAgIDpwb2ludGVyIHRvIGluc24gc3RydWN0dXJlICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgICA6IERhdGEgUG9pbnRlciB0byByZWFkIHN0YXR1cyAgfAotfCAgICAgICAgICAgICAgICAgICAgICBkYXRhWzBdICAgICAgICAgICAgICAgIDogMCAgICAgQ291bnRlcjEvVGltZXIxCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICBDb3VudGVyMi9UaW1lcjIKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgIENvdW50ZXIzL1dhdGNoZG9nCi18Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTAwX1Jl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W50aygiXG5UaW1lci9Db3VudGVyMSBub3QgY29uZmlndXJlZFxuIik7CisJCQlkZXZfd2FybihkZXYtPmh3X2RldiwKKwkJCQkiVGltZXIvQ291bnRlcjEgbm90IGNvbmZpZ3VyZWRcbiIpOwogCQkJcmV0dXJuIC1FSU5WQUw7CiAJCX0JCS8qIGVsc2VpZiggaV9UaW1lckNvdW50ZXIxSW5pdD09MSkgKi8KIAkJYnJlYWs7CkBAIC0yMjkzLDIzICsxODE4LDE3IEBACiAJCS8qIFJlYWQgY291bnRlci90aW1lcjIgKi8KIAkJaWYgKGlfVGltZXJDb3VudGVyMkluaXQgPT0gMSkgewogCQkJaWYgKGlfVGltZXJDb3VudGVyMkVuYWJsZWQgPT0gMSkgewotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2V0IFJDQyBhbmQgZ2F0ZSAqLwotCQkgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAkJCQlpX0NvbW1hbmRBbmRTdGF0dXNWYWx1ZSA9IDB4QzsKIAkJCX0JLyogaWYoIGlfVGltZXJDb3VudGVyMkluaXQ9PTEpICovCiAJCQllbHNlIHsKLQkJICAgIC8qKioqKioqKioqKioqKiovCiAJCQkJLyogU2V0IFJDQyAqLwotCQkgICAgLyoqKioqKioqKioqKioqKi8KIAogCQkJCWlfQ29tbWFuZEFuZFN0YXR1c1ZhbHVlID0gMHg4OwogCQkJfQkvKiBlbHNlaWYoaV9UaW1lckNvdW50ZXIySW5pdD09MSkgKi8KIAotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kcyBhbmQgc3RhdHVzIHJlZ2lzdGVyICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjJfQ01EX1NUQVRVUywKIAkJCQlkZXZwcml2L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qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZXQgUkNDIGFuZCBnYXRlICovCi0JCSAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJCWlfQ29tbWFuZEFuZFN0YXR1c1ZhbHVlID0gMHhDOwogCQkJfQkvKiBpZiggaV9UaW1lckNvdW50ZXIySW5pdD09MSkgKi8KIAkJCWVsc2UgewotCQkgICAgLyoqKioqKioqKioqKioqKi8KIAkJCQkvKiBTZXQgUkNDICovCi0JCSAgICAvKioqKioqKioqKioqKioqLwogCiAJCQkJaV9Db21tYW5kQW5kU3RhdHVzVmFsdWUgPSAweDg7CiAJCQl9CS8qIGVsc2VpZihpX1dhdGNoZG9nQ291bnRlcjNJbml0PT0xKSAqLwogCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmRzIGFuZCBzdGF0dXMgcmVnaXN0ZXIgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SM19DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yMzY4LDkgKzE4ODAsNyBAQAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkJIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb3VudGVyIHJlZ2lzdGVyIChoaWdoKSAqLwotCQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCW91dGIoQVBDSTE1MDBfUl9DUFRfVE1SM19WQUxVRV9ISUdILAogCQkJCWRldn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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfU1BFQ0lGSUNBVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9SZWdWYWx1ZSA9IGluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9TUEVDSUZJQ0FUSU9OLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogV3JpdGVzIHRoZSBuZXcgY29uZmlndXJhdGlvbiAoQVBDSTE1MDBfT1IpICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4RjkpIHwgQVBDSTE1MDBfT1I7CiAKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0gICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIEF1dGhvcmlzZXMgdGhlIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweEMwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIHBhdHRlcm4gcG9sYXJpdHkgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX1BPTEFSSVRZLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKGlfQ29uc3RhbnQsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBwYXR0ZXJuIHRyYW5zaXRpb24gcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX1BBVFRFUk5fVFJBTlNJVElPTiwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihpX0NvbnN0YW50LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgcGF0dGVybiBtYXNrIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9QQVRURVJOX01BU0ssCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCW91dGIoaV9Db25zdGFudCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiBwb3J0IEEgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCW91dGIoaV9SZWdWYWx1ZSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0ICBCICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9SZWdWYWx1ZSA9IGluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQl9DT01NQU5EX0FORF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHBvcnQgQiAqLwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIAlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJb3V0YihpX1JlZ1ZhbHVlLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMSAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAxICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMiAqLwotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfUmVnVmFsdWUgPSBpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAyICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAlvdXRiKGlfUmVnVmFsdWUsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJaV9SZWdWYWx1ZSA9IGluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHRpbWVyIDMgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCiAJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCW91dGIoaV9SZWdWYWx1ZSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0JIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0lOVEVSUlVQVF9DT05UUk9MLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBBdXRob3JpemVzIHRoZSBtYWluIGludGVycnVwdCBvbiB0aGUgYm9hcmQgKi8KLQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDB4RDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSV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bnRlcnJ1cHQgc3RhdHVzICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCXVpX0ludGVycnVwdFN0YXR1cyA9IGlubChkZXZwcml2LT5pX0lvYmFzZUFtY2MgKyAweDM4KTsKIAotICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFRlc3QgaWYgYm9hcmQgZ2VuZXJhdGVkIGEgaW50ZXJydXB0ICovCi0gIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJaWYgKCh1aV9JbnRlcnJ1cHRTdGF0dXMgJiAweDgwMDAwMCkgPT0gMHg4MDAwMDApIHsKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIERpc2FibGUgYWxsIEludGVycnVwdCAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCxkZXZwcml2LT5pb2Jhc2UrQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7ICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIERpc2FibGVzICB0aGUgbWFpbiBpbnRlcnJ1cHQgb24gdGhlIGJvYXJkICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIG91dGIoMHgwMCxkZXZwcml2LT5pb2Jhc2UrQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7ICovCiAKLSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQSAqLwotICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9DT01NQU5EX0FORF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiBwb3J0IEEgKi8KLQkgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCQkJb3V0YihpX1JlZ1ZhbHVlLAogCQkJCWRldnByaXYtPmlvYmFzZSArCkBAIC0yNjkzLDkgKzIwOTgsNyBAQAogCQkJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAKLQkgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJCS8qIFNlbGVjdHMgdGhlIGludGVycnVwdCB2ZWN0b3IgcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRiKEFQQ0kxNTAwX1JXX1BPUlRfQV9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CkBAIC0yNzExLDQ1ICsyMTE0LDMyIEBACiAJCQl9CS8qIGVsc2VpZihpX0xvZ2ljPT1BUENJMTUwMF9PUl9QUklPUklUWSkgKi8KIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCiAKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEIgKi8KLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpX1JlZ1ZhbHVlID0KIAkJCWluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgewotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCSAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19QT1JUX0JfQ09NTUFORF9BTkRfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBEZWxldGVzIHRoZSBpbnRlcnJ1cHQgb2YgcG9ydCBCICovCi0JICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlpX1JlZ1ZhbHVlID0gKGlfUmVnVmFsdWUgJiAweDBGKSB8IDB4MjA7CiAJCQlvdXRiKGlfUmVnVmFsdWUsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJCXByaW50aygiXG5cblxuIik7Ci0JICAgICAvKioqKioqKioqKioqKioqKi8KIAkJCS8qIFJlYWRzIHBvcnQgQiAqLwotCSAgICAgLyoqKioqKioqKioqKioqKiovCiAJCQlpX1JlZ1ZhbHVlID0KIAkJCQlpbmIoKHVuc2lnbmVkIGludCkgZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9QT1JUX0IpOwogCiAJCQlpX1JlZ1ZhbHVlID0gaV9SZWdWYWx1ZSAmIDB4QzA7Ci0JICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogVGVzdHMgaWYgdGhpcyBpcyBhbiBleHRlcm5hbCBlcnJvciAqLwotCSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCQkJaWYgKGlfUmVnVmFsdWUpIHsKIAkJCQkvKiBEaXNhYmxlIHRoZSBpbnRlcnJ1cHQgKi8KLQkJICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHBvcnQgQiAqLwotCQkgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCQlvdXRsKDB4MCwgZGV2cHJpdi0+aV9Jb2Jhc2VBbWNjICsgMHgzOCk7CiAKIAkJCQlpZiAoaV9SZWdWYWx1ZSAmIDB4ODApIHsKQEAgLTI3NjcsNDYgKzIxNTcsMzQgQEAKIAkJCX0JLyogIGlmIChpX1JlZ1ZhbHVlKSAqLwogCQl9CQkvKiBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwogCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIxX0NNRF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAxICovCi0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAkJCW91dGIoaV9SZWdWYWx1ZSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwogCQkJCUFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQkJaV9JbnRlcnJ1cHRNYXNrID0gaV9JbnRlcnJ1cHRNYXNrIHwgNDsKIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCi0JCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDIgKi8KLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaV9SZWdWYWx1ZSA9CiAJCQlpbmIoZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJCWlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApIHsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDIgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMl9DTURfU1RBVFVTLAogCQkJCWRldnByaXYtPmlvYmFzZSArCiAJCQkJQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCS8qIERlbGV0ZXMgdGhlIGludGVycnVwdCBvZiB0aW1lciAyICovCi0JCSAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJCWlfUmVnVmFsdWUgPSAoaV9SZWdWYWx1ZSAmIDB4MEYpIHwgMHgyMDsKIAkJCW91dGIoaV9SZWdWYWx1ZSwKIAkJCQlkZXZwcml2LT5pb2Jhc2UgKwpAQCAtMjgxNCwyMyArMjE5MiwxNyBAQAogCQkJaV9JbnRlcnJ1cHRNYXNrID0gaV9JbnRlcnJ1cHRNYXNrIHwgODsKIAkJfQkJLyogIGlmICgoaV9SZWdWYWx1ZSAmIDB4NjApID09IDB4NjApICovCiAKLQkJLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCQkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCQlpX1JlZ1ZhbHVlID0KIAkJCWluYihkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAkJaWYgKChpX1JlZ1ZhbHVlICYgMHg2MCkgPT0gMHg2MCkgewotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMyAqLwotCQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCQlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIzX0NNRF9TVEFUVVMsCiAJCQkJZGV2cHJpdi0+aW9iYXNlICsKIAkJCQlBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJLyogRGVsZXRlcyB0aGUgaW50ZXJydXB0IG9mIHRpbWVyIDMgKi8KLQkJICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkJaV9SZWdWYWx1ZSA9IChpX1JlZ1ZhbHVlICYgMHgwRikgfCAweDIwOwogCQkJb3V0YihpX1JlZ1ZhbHVlLAogCQkJCWRldnByaXYtPmlvYmFzZSArCkBAIC0yODQ0LDQyICsyMjE2LDIzIEBACiAJCX0JCS8qICBpZiAoKGlfUmVnVmFsdWUgJiAweDYwKSA9PSAweDYwKSAqLwogCiAJCXNlbmRfc2lnKFNJR0lPLCBkZXZwcml2LT50c2tfQ3VycmVudCwgMCk7CS8qICBzZW5kIHNpZ25hbCB0byB0aGUgc2FtcGxlICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogRW5hYmxlIGFsbCBJbnRlcnJ1cHRzICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KIAotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogU2VsZWN0cyB0aGUgbWFzdGVyIGludGVycnVwdCBjb250cm9sIHJlZ2lzdGVyICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogQXV0aG9yaXplcyB0aGUgbWFpbiBpbnRlcnJ1cHQgb24gdGhlIGJvYXJkICovCi0JICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlvdXRiKDB4R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aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAlvdXRiKDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCWlfRHVtbXlSZWFkID0gaW5iKGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwpAQCAtMjkwOCwxNiArMjI1OSwxMiBAQAogCW91dGIoMSwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgY29uZmlndXJhdGlvbiBjb250cm9sIHJlZ2lzdGVyICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfTUFTVEVSX0NPTkZJR1VSQVRJT05fQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJb3V0YigweEY0LCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKIAotCS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtb2RlIHNwZWNpZmljYXRpb24gcmVnaXN0ZXIgb2YgcG9ydCBBICovCi0JLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9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k9MX1JFR0lTVEVSKTsKLQkgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAyICovCi0JICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgSVAgYW5kIElVUyAqLwpAQCAtMzAyMiw5ICsyMzYxLDcgQEAKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVhY3RpdmF0ZXMgVGltZXIgMiBpbnRlcnJ1cHQgbWFuYWdlbWVudDogICAgICAgICAgICAgICAqLwogCW91dGIoMHhFMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiB0aW1lciAzICovCi0JICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJLyogRGVsZXRlcyBJUCBhbmQgSVVTICovCkBAIC0zMDM0LDcxICsyMzcxLDQzIEBACiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlYWN0aXZhdGVzIGludGVycnVwdCBtYW5hZ2VtZW50IG9mIHRpbWVyIDM6ICAgICAgICAgICAgKi8KIAlvdXRiKDB4RTAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotCSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLQkgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19NQVNURVJfSU5URVJSVVBUX0NPTlRST0wsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIERlbGV0ZXMgYWxsIGludGVycnVwdHMgKi8KIAlvdXRiKDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwogCS8qIHJlc2V0IGFsbCB0aGUgZGlnaXRhbCBvdXRwdXRzICovCiAJb3V0dygweDAsIGRldnByaXYtPmlfSW9iYXNlQWRkb24gKyBBUENJMTUwMF9ESUdJVEFMX09QKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGlzYWJsZSB0aGUgYm9hcmQgaW50ZXJydXB0ICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBtYXN0ZXIgaW50ZXJydXB0IGNvbnRyb2wgcmVnaXN0ZXIgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX01BU1RFUl9JTlRFUlJVUFRfQ09OVFJPTCwKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCS8qIFNlbGVjdHMgdGhlIGNvbW1hbmQgYW5kIHN0YXR1cyByZWdpc3RlciBvZiBwb3J0IEEgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19QT1JUX0FfQ09NTUFORF9BTkRfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGVhY3RpdmF0ZXMgYWxsIGludGVycnVwdHMgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweDAwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgcG9ydCBCICovCi0gLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfUE9SVF9CX0NPTU1BTkRfQU5EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDEgKi8KLSAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YihBUENJMTUwMF9SV19DUFRfVE1SMV9DTURfU1RBVFVTLAogCQlkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogRGVhY3RpdmF0ZXMgYWxsIGludGVycnVwdHMgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJb3V0YigweDAwLCBkZXZwcml2LT5pb2Jhc2UgKyBBUENJMTUwMF9aODUzNl9DT05UUk9MX1JFR0lTVEVSKTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkvKiBTZWxlY3RzIHRoZSBjb21tYW5kIGFuZCBzdGF0dXMgcmVnaXN0ZXIgb2YgdGltZXIgMiAqLwotIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKEFQQ0kxNTAwX1JXX0NQVF9UTVIyX0NNRF9TVEFUVVMsCiAJCWRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBEZWFjdGl2YXRlcyBhbGwgaW50ZXJydXB0cyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAlvdXRiKDB4MDAsIGRldnByaXYtPmlvYmFzZSArIEFQQ0kxNTAwX1o4NTM2X0NPTlRST0xfUkVHSVNURVIpOwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogLyogU2VsZWN0cyB0aGUgY29tbWFuZCBhbmQgc3RhdHVzIHJlZ2lzdGVyIG9mIHRpbWVyIDMqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoQVBDSTE1MDBfUldfQ1BUX1RNUjNfQ01EX1NUQVRVUywKIAkJZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7Ci0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIERlYWN0aXZhdGVzIGFsbCBpbnRlcnJ1cHRzICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCW91dGIoMHgwMCwgZGV2cHJpdi0+aW9iYXNlICsgQVBDSTE1MDBfWjg1MzZfQ09OVFJPTF9SRUdJU1RFUik7CiAJcmV0dXJuIDA7CiB9CmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvY29tZWRpL2RyaXZlcnMvYWRkaS1kYXRhL2h3ZHJ2X2FwY2kxNTY0LmMgYi9kcml2ZXJzL3N0YWdpbm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gIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZXMgdGhlIGRpZ2l0YWwgaW5wdXQgU3ViZGV2aWNlICAgICAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJICBkYXRhWzBdICAgICAgICAgICAgOiAxIEVuYWJsZSAgRGlnaXRhbCBJbnB1dCBJbnRlcnJ1cHQgfAotfAkJCQkJCQkJICAgMCBEaXNhYmxlIERpZ2l0YWwgSW5wdXQgSW50ZXJydXB0IHwKLXwJCQkgIGRhdGFbMV0gICAgICAgICAgICA6IDAgQURESURBVEEgSW50ZXJydXB0IE9SIExPR0lDCSB8Ci18CQkJCQkJCQkgOiAxIEFERElEQVRBIEludGVycnVwdCBBTkQgTE9HSUMgICAgfAotfAkJCSAgZGF0YVsyXQkJCSA6IEludGVycnVwdCBtYXNrIGZvciB0aGUgbW9kZSAxC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QQ0kxNTY0X0NvbmZpZ0RpZ2l0YWxPdXRwdXQgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJICAoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldixzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcywgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBjb21lZGlfaW5zbiAqaW5zbix1bnNpZ25lZCBpbnQgKmRhdGEpICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFRhc2sgICAgICAgICAgICAgIDogQ29uZmlndXJlcyBUaGUgRGlnaXRhbCBPdXRwdXQgU3ViZGV2aWNlLiAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBJbnB1dCBQYXJhbWV0ZXJzICA6IHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYgOiBEcml2ZXIgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGludCAqZGF0YSAgICAgICAgIDogRGF0YSBQb2ludGVyIGNvbnRhaW5zICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uIHBhcmFtZXRlcnMgYXMgYmVsb3cgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18CQkJCQkgIGRhdGFbMV0gICAgICAgICAgICA6IDEgRW5hYmxlICBWQ0MgIEludGVycnVwdCAgfAotfAkJCQk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fCAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sdW5zaWduZWQgaW50ICpkYXRhKSAgICAgICAgICAgICAgICAgICAgIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKwotfCBUYXNrICAgICAgICAgICAgICA6IENvbmZpZ3VyZXMgVGhlIFRpbWVyICwgQ291bnRlciBvciBXYXRjaGRvZyAgICAgICAgICAgICB8Ci0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgSW5wdXQgUGFyYW1ldGVycyAgOiBzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICAgICAgICAgICAgOiAwIENvbmZpZ3VyZSBBcyBUaW1lciAgICAgIHwKLXwJCQkJCQkJCQkJICAgMSBDb25maWd1cmUgQXMgQ291bnRlciAgICB8Ci18CQkJCQkJCQkJCSAgIDIgQ29uZmlndXJlIEFzIFdhdGNoZG9nICAgfAotfAkJCQkJICBkYXRhWzFdICAgICAgICAgICAgOiAxIEVuYWJsZSAgSW50ZXJydXB0ICA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J1Y3QgY29tZWRpX2RldmljZSAqZGV2IDogRHJpdmVyIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgKmRhdGEgICAgICAgICA6IERhdGEgUG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJICBkYXRhWzBdICAgICAgICAgICAgOiAwIFRpbWVyICAgICAgICAgICAgICAgICAgIHwKLXwJCQkJCQkJCQkJICAgMSBDb3VudGVyICAgICAgICAgICAgICAgICB8Ci18CQkJCQkJCQkJCSAgIDIgV2F0Y2hkb2cgICAgICAgIAkJIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwJCQkJCSAgICAgICAgIGRhdGFbMV0gICAgICAgICAgICA6IDEgU3RhcnQgICAgICAgICAgICAgICAgICAgfAotfAkJCQkJCQkJCQkgICAwIFN0b3AgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgVHJpZ2dlciAgICAgICAgICAgICAJIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xlYXIgKE9ubHkgQ291bnRlcikgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IE91dHB1dCBQYXJhbWV0ZXJzIDoJLS0JCQkJCQkJCQkJCQkJIHwKLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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UG9pbnRlciBjb250YWlucyAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiBwYXJhbWV0ZXJzIGFzIGJlbG93IHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotCi0rLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKLXwgT3V0cHV0IFBhcmFtZXRlcnMgOgktLQkJCQkJCQkJCQkJCQkgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi18IFJldHVybiBWYWx1ZSAgICAgIDogVFJVRSAgOiBObyBlcnJvciBvY2N1ciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwJCSAgICAgICAgICAgIDogRkFMU0UgOiBFcnJvciBvY2N1ci4gUmV0dXJuIHRoZSBlcnJvciAgICAgICAgICB8Ci18CQkJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCi0qLwotc3RhdGljIGludCBpX0FQQ0kxNTY0X1JlYWRUaW1lckNvdW50ZXJXYXRjaGRvZyhzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkJCSAgICAgICBzdHJ1Y3QgY29tZWRpX2luc24gKmluc24sCi0JCQkJCS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JCTEpICogMHgyMCkgKwotCQkJQVBDSTE1NjRfVENXX1NZTkNfRU5BQkxFRElTQUJMRSk7CisJCQlpbmwoZGV2cHJpdi0+aW9iYXNlICsKKwkJCQlBUENJMTU2NF9UQ1dfUkVHKGRldnByaXYtPmJfTW9kZVNlbGVjdFJlZ2lzdGVyIC0gMSkpOwogCQl1bF9Db21tYW5kMSA9Ci0JCQlpbmwoZGV2cHJpdi0+aW9iYXNlICsgKChkZXZwcml2LT5iX01vZGVTZWxlY3RSZWdpc3RlciAtCi0JCQkJCTEpICogMHgyMCkgKyBBUENJMTU2NF9UQ1dfVFJJR19TVEFUVVMpOworCQkJaW5sKGRldnByaXYtPmlvYmFzZSArCisJCQkJQVBDSTE1NjRfVENXX1NUQVRVU19SRUcoZGV2cHJpdi0+Yl9Nb2RlU2VsZWN0UmVnaXN0ZXIgLSAxKSk7CiAKLSAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAkJLyogR2V0IHRoZSBzb2Z0d2FyZSB0cmlnZ2VyIHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQlkYXRhWzFdID0gKHVuc2lnbmVkIGNoYXIpICgodWxfQ29tbWFuZDEgPj4gMSkgJiAxKTsKIAotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBHZXQgdGhlIGhhcmR3YXJlIHRyaWdnZXIgc3RhdHVzICovCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAJCWRhdGFbMl0gPSAodW5zaWduZWQgY2hhcikgKCh1bF9Db21tYW5kMSA+PiAyKSAmIDEpOwogCi0gICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCQkvKiBHZXQgdGhlIHNvZnR3YXJlIGNsZWFyIHN0YXR1cyAqLwotICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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AgICAyMSB0byAyMiAgICAgIDIzCisgKgkgICAgICAgICAgICAgICAgIDEgICAgICAgIDE1IHRvIDE2ICAgICAgMTcKKyAqCSAgICArLy0xMFYgICAgICAgMCAgICAgICAgMjAgdG8gMjIgICAgICAyMworICoJICAgICAgICAgICAgICAgICAxICAgICAgICAxNCB0byAxNiAgICAgIDE3CisgKgkgIDQgdG8gMjBtQSAgICAgIDAgICAgICAgIDIxIHRvIDIyICAgICAgMjUKKyAqCSAgICAgICAgICAgICAgICAgMSAgICAgICAgMTUgdG8gMTYgICAgICAxOQorICoJQUMgcmVmZXJlbmNlICAgICAwICAgICAgSW4gb24gcGluIDIyICAgIDI0ICgyLXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAgICAgICAgSW4gb24gcGluIDIyICAgIDIzICg0LXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAxICAgICAgSW4gb24gcGluIDE2ICAgIDE4ICgyLXF1YWRyYW50KQorICoJICAgICAgICAgICAgICAgICAgICAgICAgSW4gb24gcGluIDE2ICAgIDE3ICg0LXF1YWRyYW50KQorICovCitzdGF0aWMgY29uc3Qgc3RydWN0IGNvbWVkaV9scmFuZ2UgZGFzMDJfYW9fcmFuZ2VzID0geworCTYsIHsKKwkJVU5JX1JBTkdFKDUpLAorCQlVTklfUkFOR0UoMTApLAorCQlCSVBfUkFOR0UoNSksCisJCUJJUF9SQU5HRSgxMCksCisJCVJBTkdFX21BKDQsIDIwKSwKKwkJUkFOR0VfZXh0KDAsIDEpCisJfQorfTsKKworc3RydWN0IGRhYzAyX3ByaXZhdGUgeworCXVuc2lnbmVkIGludCBhb19yZWFkYmFja1syXTsKK307CisKKy8qCisgKiBSZWdpc3RlciBJL08gbWFwCisgKi8KKyNkZWZpbmUgREFDMDJfQU9fTFNCKHgpCQkoMHgwMCArICgoeCkgKiAyKSkKKyNkZWZpbmUgREFDMDJfQU9fTVNCKHgpCQkoMHgwMSArICgoeCkgKiAyKSkKKworc3RhdGljIGludCBkY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hIGZvciBBTyByZWFkYmFjayAqLworCXVuc2lnbmVkIGludCBkaXZpc29yMTsKKwl1bnNpZ25lZCBpbnQgZGl2aXNvcjI7CisJdW5zaWduZWQgaW50IHVzZV9kaWZmOjE7CisJdW5zaWduZWQgaW50IHVzZV9tcGM1MDg6MTsKKwl1bnNpZ25lZCBpbnQgdXNlX2V4dF90cmc6MTsKKwl1bnNpZ25lZCBpbnQgYWlfZG1hOjE7CisJdW5zaWduZWQgaW50IGFpX2VvczoxOwogfTsKIAotLyoKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotKi8KLXN0YXRpYyB2b2lkIHN0YXJ0X3BhY2VyKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsIGludCBtb2RlLAotCQkJdW5zaWduZWQgaW50IGRpdmlzb3IxLCB1bnNpZ25lZCBpbnQgZGl2aXNvcjIpOwotc3RhdGljIHZvaWQgc2V0dXBfcmFuZ2VfY2hhbm5lbChzdHJ1Y3QgY29tZWRpX2RldmljZSAqZGV2LAotCQkJCXN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAotCQkJCXVuc2lnbmVkIGludCByYW5nZWNoYW4sIGNoYXIgd2FpdCk7Ci1zdGF0aWMgaW50IHBjbDgxMl9haV9jYW5jZWwoc3RydWN0IGNvbWVkaV9kZXZpY2UgKmRldiwKLQkJCSAgICBzdHJ1Y3QgY29tZWRpX3N1YmRldmljZSAqcyk7Ci0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0qLwotc3RhdGljIGludCBwY2w4MTJfYWlfaW5zbl9yZWFkKHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsCi0JCQkgICAgICAgc3RydWN0IGNvbWVkaV9zdWJkZXZpY2UgKnMsCi0JCQkgICAgICAgc3RydWN0IGNvb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WN0IGdhaW4gKi8KLQl9Ci0KLQl1ZGVsYXkoMSk7Ci0KLQkvKiBzZWxlY3QgY2hhbm5lbCBpbnRlcnZhbCB0byBzY2FuICovCi0Jb3V0YihkZXZwcml2LT5hY3RfY2hhbmxpc3RbMF0gfCAoZGV2cHJpdi0+YWN0X2NoYW5saXN0W3NlZ2xlbiAtCi0JCQkJCQkJICAgICAgIDFdIDw8IDQpLAotCSAgICAgZGV2LT5pb2Jhc2UgKyBQQ0w4MThfTVVYKTsKLX0KLQotLyoKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotIENoZWNrIGlmIGJvYXJkIGlzIHN3aXRjaGVkIHRvIFNFICgxKSBvciBESUZGKDApIG1vZGUKLSovCiBzdGF0aWMgaW50IGNoZWNrX3NpbmdsZV9lbmRlZCh1bnNpZ25lZCBpbnQgcG9ydCkKIHsKLQlpZiAoaW5iKHBvcnQgKyBQQ0w4MThfU1RBVFVTKSAmIDB4MjApCisJaWYgKGluYihwb3J0ICsgUENMODE4X1NUQVRVU19SRUcpICYgUENMODE4X1NUQVRVU19NVVgpCiAJCXJldHVybiAxOwogCXJldHVybiAwOwogfQogCi0vKgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0qLwogc3RhdGljIGludCBhaV9jbWR0ZXN0KHN0cnVjdCBjb21lZGlfZGV2aWNlICpkZXYsIHN0cnVjdCBjb21lZGlfc3ViZGV2aWNlICpzLAogCQkgICAgICBzdHJ1Y3QgY29tZWRpX2NtZCAqY21kKQogewogCWNvbnN0IHN0cnVjdCBwY2w4MThfYm9hcmQgKmJvYXJkID0gY29tZWRpX2JvYXJkKGRldik7CiAJc3RydWN0IHBjbDgxOF9wcml2YXRlICpkZXZwcml2ID0gZGV2LT5wcml2YXRlOwogCWludCBlcnIgPSAwOwotCWlud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VRFICgpOyAgICAgICAgICAgICAvKiBUaGlzIHJvdXRpbmUgaXMgY2FsbGVkIGZyb20gcm91dGluZXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdoaWNoIGRvIG11bHRpcGxlIHJlZ2lzdGVyIHdyaXRlcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd2hpY2ggdGhlbXNlbHZlcyBuZWVkIGZsdXNoaW5nIGJldHdlZW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRlcyBpbiBvcmRlciB0byBndWFyYW50ZWUgd3JpdGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9yZGVyaW5nLiAgSXQgaXMgbGVzcyBjb2RlLWN1bWJlcnNvbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHRvIGZsdXNoIGhlcmUtaW4gdGhlbiB0byBpbnZlc3RpZ2F0ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIGNvZGUgdGhlIG1hbnkgb3RoZXIgcmVnaXN0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHdyaXRpbmcgcm91dGluZXMuICovCisJKnAgPSBjcHVfdG9fbGUzMiAodik7CisJRkxVU0hfUENJX1dSSVRFKCk7ICAgICAgICAgICAgIC8qIFRoaXMgcm91dGluZSBpcyBjYWxsZWQgZnJvbSByb3V0aW5lcworCQkJCQkqIHdoaWNoIGRvIG11bHRpcGxlIHJlZ2lzdGVyIHdyaXRlcworCQkJCQkqIHdoaWNoIHRoZW1zZWx2ZXMgbmVlZCBmbHVzaGluZyBiZXR3ZWVuCisJCQkJCSogd3JpdGVzIGluIG9yZGVyIHRvIGd1YXJhbnRlZSB3cml0ZQorCQkJCQkqIG9yZGVyaW5nLiAgSXQgaXMgbGVzcyBjb2RlLWN1bWJlcnNvbWUKKwkJCQkJKiB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XQtPl9fcmVzMjYpOyAgICAgLyogMHg5OCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDM6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzMjcpOyAgICAgLyogMHg5QyAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDQ6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzODgpOyAgICAgLyogMHgyMjAgKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSA1OgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlczg5KTsgICAgIC8qIDB4MjI0ICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgNjoKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXM4QSk7ICAgICAvKiAweDIyOCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDc6Ci0gICAgICAgIGRhdGEgPSBwY2lfcmVhZF8zMiAoKHVfaW50MzJfdCAqKSAmY29tZXQtPl9fcmVzOEIpOyAgICAgLyogMHgyMkMgKi8KLSAgICAgICAgYnJlYWs7Ci0gICAgY2FzZSA4OgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbWV0LT5fX3Jlc0EwKTsgICAgIC8qIDB4MjgwICovCi0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgOToKLSAgICAgICAgZGF0YSA9IHBjaV9yZWFkXzMyICgodV9pbnQzMl90ICopICZjb21ldC0+X19yZXNBMSk7ICAgICAvKiAweDI4NCAqLwotICAgICAgICBicmVhazsKLSAgICBjYXNlIDEwOgotICAgICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgJmNvbW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AgYzRfc3RvcHdkIChjaV90ICopOwotc3RydWN0IG5ldF9kZXZpY2UgKiBfX2luaXQgYzRfYWRkX2RldiAoaGR3X2luZm9fdCAqLCBpbnQsIHVuc2lnbmVkIGxvbmcsIHVuc2lnbmVkIGxvbmcsIGludCwgaW50KTsKK3ZvaWQgICAgICAgIGM0X3N0b3B3ZChjaV90ICopOworc3RydWN0IG5ldF9kZXZpY2UgKiBfX2luaXQgYzRfYWRkX2RldihoZHdfaW5mb190ICosIGludCwgdW5zaWduZWQgbG9uZywKKwkJCQkgICAgICB1bnNpZ25lZCBsb25nLCBpbnQsIGludCk7CiAKIAogc3RydWN0IHNfaGR3X2luZm8gaGR3X2luZm9bTUFYX0JPQVJEU107CiAKIAotdm9pZCAgICAgICAgX19pbml0Ci1zaG93X3R3byAoaGR3X2luZm9fdCAqaGksIGludCBicmRubykKK3ZvaWQgX19pbml0CitzaG93X3R3byhoZHdfaW5mb190ICpoaSwgaW50IGJyZG5vKQogewotICAgIGNpX3QgICAgICAgKmNpOwotICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2OwotICAgIGNoYXIgICAgICAgKmJpZDsKLSAgICBjaGFyICAgICAgICpicCwgYmFubmVyWzgwXTsKLSAgICBjaGFyICAgICAgICBzbls2XTsKKwljaV90ICAgICAgICpjaTsKKwlzdHJ1Y3QgcGNpX2RldiAqcGRldjsKKwljaGFyICAgICAgICpiaWQ7CisJY2hhciAgICAgICBiYW5uZXJbODBdOworCWNoYXIJc25bNl0gPSB7MCx9OwogCi0gICAgYnAgPSBiYW5uZXI7Ci0gICAgbWVtc2V0IChiYW5uZXIsIDAsIDgwKTsgICAgICAgICAvKiBjbGVhciBwcmludCBidWZmZXIgKi8KKwljaSA9IChjaV90ICopKG5ldGRldl9wcml2KGhpLT5uZGV2KSk7CisJYmlkID0gc2JlaWRfZ2V0X2JkbmFtZShjaSk7CisJc3dpdGNoIChoaS0+cHJvbWZtdCkgeworCWNhc2UgUFJPTV9GT1JNQVRfVFlQ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vX3QgKmhpOwotICAgIGludCAgICAgICAgIGk7CisJaGR3X2luZm9fdCAqaGk7CisJaW50ICAgICAgICAgaTsKIAotICAgIGZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspCi0gICAgewotICAgICAgICBpZiAoaGktPnBjaV9zbG90ID09IDB4ZmYgfHwgIWhpLT5uZGV2KQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGM0X3N0b3B3ZChuZXRkZXZfcHJpdihoaS0+bmRldikpOworCWZvciAoaSA9IDAsIGhpID0gaGR3X2luZm87IGkgPCBNQVhfQk9BUkRTOyBpKyssIGhpKyspIHsKKwkJaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmIHx8ICFoaS0+bmRldikKKwkJCWJyZWFrOworCQljNF9zdG9wd2QobmV0ZGV2X3ByaXYoaGktPm5kZXYpKTsKICNpZmRlZiBDT05GSUdfUFJPQ19GUwotICAgICAgICBzYmVjb21fcHJvY19icmRfY2xlYW51cChuZXRkZXZfcHJpdihoaS0+bmRldikpOworCQlzYmVjb21fcHJvY19icmRfY2xlYW51cChuZXRkZXZfcHJpdihoaS0+bmRldikpOwogI2VuZGlmCi0gICAgICAgIHVucmVnaXN0ZXJfbmV0ZGV2IChoaS0+bmRldik7Ci0gICAgICAgIGZyZWVfaXJxIChoaS0+cGRldlswXS0+aXJxLCBoaS0+bmRldik7CisJCXVucmVnaXN0ZXJfbmV0ZGV2KGhpLT5uZGV2KTsKKwkJZnJlZV9pcnEoaGktPnBkZXZbMF0tPmlycSwgaGktPm5kZXYpOwogI2lmZGVmIENPTkZJR19TQkVfUE1DQzRfTkNPTU0KLSAgICAgICAgZnJlZV9pcnEgKGhpLT5wZGV2WzFdLT5pcnEsIGhpLT5uZGV2KTsKKwkJZnJlZV9pcnEoaGktPnBkZXZbMV0tPmlycSwgaGktPm5kZXYpOwogI2VuZGlmCi0gICAgICAgIE9TX2tmcmVlIChoaS0+bmRldik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dW5kID0gMCwgaSwgajsKKwloZHdfaW5mb190ICpoaTsKKwlzdHJ1Y3QgcGNpX2RldiAqcGRldiA9IE5VTEw7CisJaW50ICAgICAgICAgZm91bmQgPSAwLCBpLCBqOwogCi0gICAgZXJyb3JfZmxhZyA9IDA7Ci0gICAgcHJlcF9oZHdfaW5mbyAoKTsKLSAgICAvKioqIHNjYW4gUENJIGJ1cyBmb3IgYWxsIHBvc3NpYmxlIGJvYXJkcyAqLwotICAgIHdoaWxlICgocGRldiA9IHBjaV9nZXRfZGV2aWNlIChQQ0lfVkVORE9SX0lEX0NPTkVYQU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUENJX0RFVklDRV9JRF9DTjg0NzQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZGV2KSkpCi0gICAgewotICAgICAgICBpZiAoYzRfaGR3X2luaXQgKHBkZXYsIGZvdW5kKSkKLSAgICAgICAgICAgIGZvdW5kKys7Ci0gICAgfQotICAgIGlmICghZm91bmQpCi0gICAgewotICAgICAgICBwcl93YXJuaW5nKCJObyBib2FyZHMgZm91bmRcbiIpOwotICAgICAgICByZXR1cm4gLUVOT0RFVjsKLSAgICB9Ci0gICAgLyogc2FuaXR5IGNoZWNrIGZvciBjb25zaXN0ZW50IGhhcmR3YXJlIGZvdW5kICovCi0gICAgZm9yIChpID0gMCwgaGkgPSBoZHdfaW5mbzsgaSA8IE1BWF9CT0FSRFM7IGkrKywgaGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChoaS0+cGNpX3Nsb3QgIT0gMHhmZiAmJiAoIWhpLT5hZGRyWzBdIHx8ICFoaS0+YWRkclsxXSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByX3dhcm5pbmcoIiVzOiBzb21ldGhpbmcgdmVyeSB3cm9uZyB3aXRoIHBjaV9nZXRfZGV2aWNlXG4iLAotICAgICAgICAgICAgICAgICAgICAgICBoaS0+ZGV2bmFtZSk7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTzsKLSAgICAgICAgfQotICAgIH0KLSAgICAvKiBicmluZyBib2FyZCdzIG1lbW9yeSByZWdpb25zIG9uL2xpbmUgKi8KLSAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGhpLT5wY2lfc2xvdCA9PSAweGZmKQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCi0gICAgICAgIHsKLQkgICAgaWYgKCFyZXF1ZXN0X21lbV9yZWdpb24gKGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdLCBoaS0+ZGV2bmFtZSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IG1lbW9yeSBpbiB1c2UsIGFkZHI9MHglbHgsIGxlbj0weCVseCA/XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUsIGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKLSAgICAgICAgICAgICAgICBjbGVhbnVwX2lvcmVtYXAgKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FTk9NRU07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBoaS0+YWRkcl9tYXBwZWRbal0gPSAodW5zaWduZWQgbG9uZykgaW9yZW1hcCAoaGktPmFkZHJbal0sIGhpLT5sZW5bal0pOwotICAgICAgICAgICAgaWYgKCFoaS0+YWRkcl9tYXBwZWRbal0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJfd2FybmluZygiJXM6IGlvcmVtYXAgZmFpbHMsIGFkZHI9MHglbHgsIGxlbj0weCVseCA/XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPmRldm5hbWUsIGhpLT5hZGRyW2pdLCBoaS0+bGVuW2pdKTsKLSAgICAgICAgICAg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ZXYgKGhpLCBpLCAobG9uZykgaGktPmFkZHJfbWFwcGVkWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsb25nKSBoaS0+YWRkcl9tYXBwZWRbMV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGktPnBkZXZbMF0tPmlycSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaS0+cGRldlsxXS0+aXJxKSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRydnJfc3RhdGUgPSBTQkVfRFJWUl9ET1dOOwotICAgICAgICAgICAgY2xlYW51cF9pb3JlbWFwICgpOwotICAgICAgICAgICAgLyogTk9URTogYzRfYWRkX2RldigpIGRvZXMgaXRzIG93biBkZXZpY2UgY2xlYW51cCAqLworCS8qIEhhdmUgbm93IG1lbW9yeSBtYXBwZWQgYWxsIGJvYXJkcy4gIE5vdyBhbGxvdyBib2FyZCdzIGFjY2VzcyB0byBzeXN0ZW0gKi8KKwlmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKSB7CisJCWlmIChoaS0+cGNpX3Nsb3QgPT0gMHhmZikKKwkJCWJyZWFrOworCQlpZiAocGNpX2VuYWJsZV9kZXZpY2UoaGktPnBkZXZbMF0pIHx8CisJCSAgICBwY2lfZW5hYmxlX2RldmljZShoaS0+cGRldlsxXSkpIHsKKwkJCWRydnJfc3RhdGUgPSBTQkVfRFJWUl9ET1dOOworCQkJcHJfd2FybmluZygiJXM6IGZhaWxlZCB0byBlbmFibGUgY2FyZCAlZCBzbG90ICVkXG4iLAorCQkJCSAgIGhpLT5kZXZuYW1lLCBpLCBoaS0+cGNpX3Nsb3QpOworCQkJY2xlYW51cF9kZXZzKCk7CisJCQljbGVhbnVwX2lvcmVtYXAoKTsKKwkJCXJldHVybiAtRUlPOworCQl9CisJCXBjaV9zZXRfbWFzdGVyKGhpLT5wZGV2WzB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zdGFnaW5nL2N4dDFlMS9saW51eC5jIGIvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9saW51eC5jCmluZGV4IDc5MjA2Y2IuLmIwMmY1YWRlIDEwMDY0NAotLS0gYS9kcml2ZXJzL3N0YWdpbmcvY3h0MWUxL2xpbnV4LmMKKysrIGIvZHJpdmVycy9zdGFnaW5nL2N4dDFlMS9saW51eC5jCkBAIC0zMSw3ICszMSw3IEBACiAjaW5jbHVkZSAicG1jYzRfcHJpdmF0ZS5oIgogI2luY2x1ZGUgInNiZXByb2MuaCIKIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICogRXJyb3Igb3V0IGVhcmx5IGlmIHdlIGhhdmUgY29tcGlsZXIgdHJvdWJsZS4KICAqCiAgKiAgIChUaGlzIHNlY3Rpb24gaXMgaW5jbHVkZWQgZnJvbSB0aGUga2VybmVsJ3MgaW5pdC9tYWluLmMgYXMgYSBmcmllbmRseQpAQCAtNTAsNDMgKzUwLDQyIEBACiAjd2FybmluZyBnY2MtNC4xLjAgaXMga25vd24gdG8gbWlzY29tcGlsZSB0aGUga2VybmVsLiAgQSBkaWZmZXJlbnQgY29tcGlsZXIgdmVyc2lvbiBpcyByZWNvbW1lbmRlZC4KICNlbmRpZgogCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogI2RlZmluZSBDSEFOTkFNRSAiaGRsYyIKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBmb3J3YXJkIHJlZmVyZW5jZXMgKi8KLXN0YXR1c190ICAgIGM0X2NoYW5fd29ya19pbml0IChtcGlfdCAqLCBtY2hfdCAqKTsKLXZvaWQgICAgICAgIG11c3ljY193cV9jaGFuX3Jlc3RhcnQgKHZvaWQgKik7Ci1zdGF0dXNfdCBfX2luaXQgYzRfaW5pdCAoY2lfdCAqLCB1X2NoYXIgKiwgdV9jaGFyICopOwotc3RhdHVzX3QgX19pbml0IGM0X2luaXQyIChjaV90ICopOwotY2lfdCAgICAgICAqX19pbml0IGM0X25ldyAodm9pZCAqKTsKLWludCBfX2luaXQgIGM0aHdfYXR0YWNoX2FsbCAodm9pZCk7Ci12b2lkIF9faW5pdCBoZHdfc25fZ2V0IChoZHdfaW5mb190ICosIGludCk7CitzdGF0dXNfdCAgICBjNF9jaGFuX3dvcmtfaW5pdChtcGlfdCAqLCBtY2hfdCAqKTsKK3ZvaWQgICAgICAgIG11c3ljY193cV9jaGFuX3Jlc3RhcnQodm9pZCAqKTsKK3N0YXR1c190IF9faW5pdCBjNF9pbml0KGNpX3QgKiwgdV9jaGFyICosIHVfY2hhciAqKTsKK3N0YXR1c190IF9faW5pdCBjNF9pbml0MihjaV90ICopOworY2lfdCAgICAgICAqX19pbml0IGM0X25ldyh2b2lkICopOworaW50IF9faW5pdCAgYzRod19hdHRhY2hfYWxsKHZvaWQpOwordm9pZCBfX2luaXQgaGR3X3NuX2dldChoZHdfaW5mb190ICosIGludCk7CiAKICNpZmRlZiBDT05GSUdfU0JFX1BNQ0M0X05DT01NCi1pcnFyZXR1cm5fdCBjNF9lYnVzX2ludHJfdGhfaGFuZGxlciAodm9pZCAqKTsKK2lycXJldHVybl90IGM0X2VidXNfaW50cl90aF9oYW5kbGVyKHZvaWQgKik7CiAKICNlbmRpZgotaW50ICAgICAgICAgYzRfZnJhbWVfcncgKGNpX3QgKiwgc3Ryd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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAotdm9pZCAgICAgICAqCi1nZXR1c2VyYnljaGFuIChpbnQgY2hhbm51bSkKK3ZvaWQgKgorZ2V0dXNlcmJ5Y2hhbihpbnQgY2hhbm51bSkKIHsKLSAgICBtY2hfdCAgICAgICpjaDsKKwltY2hfdCAgICAgICpjaDsKIAotICAgIGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKTsKLSAgICByZXR1cm4gY2ggPyBjaC0+dXNlciA6IE5VTEw7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJcmV0dXJuIGNoID8gY2gtPnVzZXIgOiBOVUxMOwogfQogCiAKLWNoYXIgICAgICAgKgotZ2V0X2hkbGNfbmFtZSAoaGRsY19kZXZpY2UgKmhkbGMpCitjaGFyICoKK2dldF9oZGxjX25hbWUoaGRsY19kZXZpY2UgKmhkbGMpCiB7Ci0gICAgc3RydWN0IGM0X3ByaXYgKnByaXYgPSBoZGxjLT5wcml2OwotICAgIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBnZXR1c2VyYnljaGFuIChwcml2LT5jaGFubnVtKTsKKwlzdHJ1Y3QgYzRfcHJpdiAqcHJpdiA9IGhkbGMtPnByaXY7CisJc3RydWN0IG5ldF9kZXZpY2UgKmRldiA9IGdldHVzZXJieWNoYW4ocHJpdi0+Y2hhbm51bSk7CiAKLSAgICByZXR1cm4gZGV2LT5uYW1lOwotfQotCi0KLXN0YXRpYyAgICAgIHN0YXR1c190Ci1ta3JldCAoaW50IGJzZCkKLXsKLSAgICBpZiAoYnNkID4gMCkKLSAgICAgICAgcmV0dXJuIC1ic2Q7Ci0gICAgZWxzZQotICAgICAgICByZXR1cm4gYnNkOworCXJldHVybiBk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GNfb3BlbiBmYWlsdXJlLCBlcnIgJWQuXG4iLCByZXQpOwotICAgICAgICByZXR1cm4gcmV0OwotICAgIH0KLSAgICBpZiAoKHJldCA9IGM0X2NoYW5fdXAgKHByaXYtPmNpLCBwcml2LT5jaGFubnVtKSkpCi0gICAgICAgIHJldHVybiAtcmV0OwotICAgIHRyeV9tb2R1bGVfZ2V0IChUSElTX01PRFVMRSk7Ci0gICAgbmV0aWZfc3RhcnRfcXVldWUgKG5kZXYpOwotICAgIHJldHVybiAwOyAgICAgICAgICAgICAgICAgICAgICAgLyogbm8gZXJyb3IgPSBzdWNjZXNzICovCisJcmV0ID0gaGRsY19vcGVuKG5kZXYpOworCWlmIChyZXQpIHsKKwkJcHJfaW5mbygiaGRsY19vcGVuIGZhaWx1cmUsIGVyciAlZC5cbiIsIHJldCk7CisJCXJldHVybiByZXQ7CisJfQorCisJcmV0ID0gYzRfY2hhbl91cChwcml2LT5jaSwgcHJpdi0+Y2hhbm51bSk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisJdHJ5X21vZHVsZV9nZXQoVEhJU19NT0RVTEUpOworCW5ldGlmX3N0YXJ0X3F1ZXVlKG5kZXYpOworCXJldHVybiAwOyAgICAgICAgICAgICAgICAgICAgICAgLyogbm8gZXJyb3IgPSBzdWNjZXNzICovCiB9CiAKIAogc3RhdGljIGludAotY2hhbl9jbG9zZSAoc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYpCitjaGFuX2Nsb3NlKHN0cnVjdCBuZXRfZGV2aWNlICpuZGV2KQogewotICAgIGhkbGNfZGV2aWNlICpoZGxjID0gZGV2X3RvX2hkbGMgKG5kZXYpOwotICAgIGNvbnN0IHN0cnVjdCBjNF9wcml2ICpwcml2ID0gaGRsYy0+cHJpdjsKKwloZGxjX2RldmljZSAqaGRsYyA9IGRldl90b19oZGxjKG5kZXYpOworCWNvbnN0IHN0cnVjdCBjNF9wcml2ICpwcml2ID0gaGRsYy0+cHJpdjsKIAotICAgIG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IG5ldF9kZXZpY2UgKm5kZXYsIGludCBsb2NraXQpCitzdGF0aWMgc3RhdHVzX3QKK2RvX2RlbHVzZXIoc3RydWN0IG5ldF9kZXZpY2UgKm5kZXYsIGludCBsb2NraXQpCiB7Ci0gICAgaWYgKG5kZXYtPmZsYWdzICYgSUZGX1VQKQotICAgICAgICByZXR1cm4gLUVCVVNZOworCWlmIChuZGV2LT5mbGFncyAmIElGRl9VUCkKKwkJcmV0dXJuIC1FQlVTWTsKIAotICAgIHsKLSAgICAgICAgY2lfdCAgICAgICAqY2k7Ci0gICAgICAgIG1jaF90ICAgICAgKmNoOwotICAgICAgICBjb25zdCBzdHJ1Y3QgYzRfcHJpdiAqcHJpdjsKLSAgICAgICAgaW50ICAgICAgICAgY2hhbm51bTsKKwl7CisJCWNpX3QgICAgICAgKmNpOworCQltY2hfdCAgICAgICpjaDsKKwkJY29uc3Qgc3RydWN0IGM0X3ByaXYgKnByaXY7CisJCWludCAgICAgICAgIGNoYW5udW07CiAKLSAgICAgICAgcHJpdiA9IChzdHJ1Y3QgYzRfcHJpdiAqKSBkZXZfdG9faGRsYyAobmRldiktPnByaXY7Ci0gICAgICAgIGNpID0gcHJpdi0+Y2k7Ci0gICAgICAgIGNoYW5udW0gPSBwcml2LT5jaGFubnVtOworCQlwcml2ID0gKHN0cnVjdCBjNF9wcml2ICopZGV2X3RvX2hkbGMobmRldiktPnByaXY7CisJCWNpID0gcHJpdi0+Y2k7CisJCWNoYW5udW0gPSBwcml2LT5jaGFubnVtOwogCi0gICAgICAgIGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKTsKLSAgICAgICAgaWYgKGNoID09IE5VTEwpCi0gICAgICAgICAgICByZXR1cm4gLUVOT0VOVDsKLQljaC0+dXNlciA9IE5VTEw7CS8qIHdpbGwgYmUgZnJlZWQsIGJlbG93ICovCi0gICAgfQorCQljaCA9IGM0X2ZpbmRfY2hhbihjaGFubnVtKTsKKwkJaWYgKGNoID09IE5VTEwpCisJCQlyZX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rZnJlZSAobmV0ZGV2X3ByaXYobmRldikpOwotICAgICAgICBPU19rZnJlZSAobmRldik7Ci0gICAgICAgIGVycm9yX2ZsYWcgPSBFTk9ERVY7Ci0JcmV0dXJuIE5VTEw7Ci0gICAgfQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICogIGludCByZXF1ZXN0X2lycSh1bnNpZ25lZCBpbnQgaXJxLAotICAgICAqICAgICAgICAgICAgICAgICAgdm9pZCAoKmhhbmRsZXIpKGludCwgdm9pZCAqLCBzdHJ1Y3QgcHRfcmVncyAqKSwKLSAgICAgKiAgICAgICAgICAgICAgICAgIHVuc2lnbmVkIGxvbmcgZmxhZ3MsIGNvbnN0IGNoYXIgKmRldl9uYW1lLCB2b2lkICpkZXZfaWQpOwotICAgICAqICB3aGVyZWluOgotICAgICAqICBpcnEgICAgICAtPiBUaGUgaW50ZXJydXB0IG51bWJlciB0aGF0IGlzIGJlaW5nIHJlcXVlc3RlZC4KLSAgICAgKiAgaGFuZGxlciAgLT4gUG9pbnRlciB0byBoYW5kbGluZyBmdW5jdGlvbiBiZWluZyBpbnN0YWxsZWQuCi0gICAgICogIGZsYWdzICAgIC0+IEEgYml0IG1hc2sgb2Ygb3B0aW9ucyByZWxhdGVkIHRvIGludGVycnVwdCBtYW5hZ2VtZW50LgotICAgICAqICBkZXZfbmFtZSAtPiBTdHJpbmcgdXNlZCBpbiAvcHJvYy9pbnRlcnJ1cHRzIHRvIHNob3cgb3duZXIgb2YgaW50ZXJydXB0LgotICAgICAqICBkZXZfaWQgICAtPiBQb2ludGVyIChmb3Igc2hhcmVkIGludGVycnVwdCBsaW5lcykgdG8gcG9pbnQgdG8gaXRzIG93bgotICAgICAqICAgICAgICAgICAgICBwcml2YXRlIGRhdGEgYXJlYSAodG8gaWRlbnRpZnkgd2hpY2ggZGV2aWNlIGlzIGludGVycnVwdGluZykuCi0gICAgICoKLSAgICAgKiAgZXh0ZXJuIHZvaWQgZnJlZV9pcnEodW5zaWduZWQgaW50IGlycSwgdm9pZCAqZGV2X2lkKTsKLSAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisJaWYgKHJlZ2lzdGVyX25ldGRldihuZGV2KSB8fAorCQkoYzRfaW5pdChjaSwgKHVfY2hhciAqKSBmMCwgKHVfY2hhciAqKSBmMSkgIT0gU0JFX0RSVlJfU1VDQ0VTUykpIHsKKwkJT1Nfa2ZyZWUobmV0ZGV2X3ByaXYobmRldikpOworCQlPU19rZnJlZShuZGV2KTsKKwkJZXJyb3JfZmxhZyA9IC1FTk9ERVY7CisJCXJldHVybiBOVUxMOworCX0KKwkvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCSAqICBpbnQgcmVxdWVzdF9pcnEodW5zaWduZWQgaW50IGlycSwKKwkgKiAgICAgICAgICAgICAgICAgIHZvaWQgKCpoYW5kbGVyKShpbnQsIHZvaWQgKiwgc3RydWN0IHB0X3JlZ3MgKiksCisJICogICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGZsYWdzLCBjb25zdCBjaGFyICpkZXZfbmFtZSwgdm9pZCAqZGV2X2lkKTsKKwkgKiAgd2hlcmVpbjoKKwkgKiAgaXJxICAgICAgLT4gVGhlIGludGVycnVwdCBudW1iZXIgdGhhdCBpcyBiZWluZyByZXF1ZXN0ZWQuCisJICogIGhhbmRsZXIgIC0+IFBvaW50ZXIgdG8gaGFuZGxpbmcgZnVuY3Rpb24gYmVpbmcgaW5zdGFsbGVkLgorCSAqICBmbGFncyAgICAtPiBBIGJpdCBtYXNrIG9mIG9wdGlvbnMgcmVsYXRlZCB0byBpbnRlcnJ1cHQgbWFuYWdlbWVudC4KKwkgKiAgZGV2X25hbWUgLT4gU3RyaW5nIHVzZWQgaW4gL3Byb2MvaW50ZXJydXB0cyB0byBzaG93IG93bmVyIG9mIGludGVycnVwdC4KKwkgKiAgZGV2X2lkICAgLT4gUG9pbnRlciAoZm9yIHNoYXJlZCBpbnRlcnJ1cHQgbGluZXMpIHRvIHBvaW50IHRvIGl0cyBvd24KKwkgKiAgICAgICAgICAgICAgcHJpdmF0ZSBkYXRhIGFyZWEgKHRvIGlkZW50aWZ5IHdoaWNoIGRldmljZSBpcyBpbnRlcnJ1cHRpbmcpLgorCSAqCisJICogIGV4dGVybiB2b2lkIGZyZWVfaXJxKHVuc2lnbmVkIGludCBpcnEsIHZvaWQgKmRldl9pZCk7CisJICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogCi0gICAgaWYgKHJlcXVlc3RfaXJxIChpcnEwLCAmYzRfbGludXhfaW50ZXJydXB0LAotICAgICAgICAgICAgICAgICAgICAgSVJRRl9TSEFSRUQsCi0gICAgICAgICAgICAgICAgICAgICBuZGV2LT5uYW1lLCBuZGV2KSkKLSAgICB7Ci0gICAgICAgIHByX3dhcm5pbmcoIiVzOiBNVVNZQ0MgY291bGQgbm90IGdldCBpcnE6ICVkXG4iLCBuZGV2LT5uYW1lLCBpcnEwKTsKLSAgICAgICAgdW5yZWdpc3Rlcl9uZXRkZXYgKG5kZXYpOwotICAgICAgICBPU19rZnJlZSAobmV0ZGV2X3ByaXYobmRldikpOwotICAgICAgICBPU19rZnJlZSAobmRldik7Ci0gICAgICAgIGVycm9yX2ZsYWcgPSBFSU87Ci0JcmV0dXJuIE5VTEw7Ci0gICAgfQorCWlmIChyZXF1ZXN0X2lycShpcnEwLCAmYzRfbGludXhfaW50ZXJydXB0LAorCQkJSVJRRl9TSEFSRUQsCisJCQluZGV2LT5uYW1lLCBuZGV2KSkgeworCQlwcl93YXJuaW5nKCIlczogTVVTWUNDIGNvdWxkIG5vdCBnZXQgaXJxOiAlZFxuIiwKKwkJCSAgIG5kZXYtPm5hbWUsIGlycTApOworCQl1bnJlZ2lz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JtYXRpb24gKi8KKwkvKiBzZXR1cCBib2FyZCBpZGVudGlmaWNhdGlvbiBpbmZvcm1hdGlvbiAqLwogCi0gICAgewotICAgICAgICB1X2ludDMyX3QgICB0bXA7CisJeworCQl1X2ludDMyX3QgICB0bXA7CiAKLSAgICAgICAgaGR3X3NuX2dldCAoaGksIGJyZG5vKTsgICAgIC8qIGFsc28gc2V0cyBQUk9NIGZvcm1hdCB0eXBlIChwcm9tZm10KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZm9yIGxhdGVyIHVzYWdlICovCisJCS8qIGFsc28gc2V0cyBQUk9NIGZvcm1hdCB0eXBlIChwcm9tZm10KSBmb3IgbGF0ZXIgdXNhZ2UgKi8KKwkJaGR3X3NuX2dldChoaSwgYnJkbm8pOwogCi0gICAgICAgIHN3aXRjaCAoaGktPnByb21mbXQpCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMToKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUxICopIChoaS0+bWZnX2luZm8ucGZ0MS5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBQUk9NX0ZPUk1BVF9UWVBFMjoKLSAgICAgICAgICAgIG1lbWNweSAobmRldi0+ZGV2X2FkZHIsIChGTERfVFlQRTIgKikgKGhpLT5tZmdfaW5mby5wZnQyLlNlcmlhbCksIDYpOwotICAgICAgICAgICAgbWVtY3B5ICgmdG1wLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5JZCksIDQpOyAgICAgLyogdW5hbGlnbmVkIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFjcXVpc2l0aW9uICovCi0gICAgICAgICAgICBjaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIgKHRtcCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGNpLT5icmRfaWQgPSAwOwotICAgICAgICAgICAgbWVtc2V0IChuZGV2LT5kZXZfYWRkciwgMCwgNik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQorCQlzd2l0Y2ggKGhpLT5wcm9tZm10KSB7CisJCWNhc2UgUFJPTV9GT1JNQVRfVFlQRTE6CisJCQltZW1jcHkobmRldi0+ZGV2X2FkZHIsCisJCQkgICAgICAgKEZMRF9UWVBFMSAqKSAoaGktPm1mZ19pbmZvLnBmdDEuU2VyaWFsKSwgNik7CisJCQkvKiB1bmFsaWduZWQgZGF0YSBhY3F1aXNpdGlvbiAqLworCQkJbWVtY3B5KCZ0bXAsIChGTERfVFlQRTEgKikgKGhpLT5tZmdfaW5mby5wZnQxLklkKSwgNCk7CisJCQljaS0+YnJkX2lkID0gY3B1X3RvX2JlMzIodG1wKTsKKwkJCWJyZWFrOworCQljYXNlIFBST01fRk9STUFUX1RZUEUyOgorCQkJbWVtY3B5KG5kZXYtPmRldl9hZGRyLAorCQkJICAgICAgIChGTERfVFlQRTIgKikgKGhpLT5tZmdfaW5mby5wZnQyLlNlcmlhbCksIDYpOworCQkJLyogdW5hbGlnbmVkIGRhdGEgYWNxdWlzaXRpb24gKi8KKwkJCW1lbWNweSgmdG1wLCAoRkxEX1RZUEUyICopIChoaS0+bWZnX2luZm8ucGZ0Mi5JZC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eGRlc2NfZGVmYXVsdCwgbWF4X3R4ZGVzY191c2VkKTsKKwl9CisJcmV0dXJuIDA7ICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnN0YWxsYXRpb24gc3VjY2VzcyAqLwogfQogCiAKQEAgLTExNDAsMzEgKzExMTcsMjkgQEAKICAgKi8KIAogc3RhdGljIHZvaWQgX19leGl0Ci1jbGVhbnVwX2hkbGMgKHZvaWQpCitjbGVhbnVwX2hkbGModm9pZCkKIHsKLSAgICBoZHdfaW5mb190ICpoaTsKLSAgICBjaV90ICAgICAgICpjaTsKLSAgICBzdHJ1Y3QgbmV0X2RldmljZSAqbmRldjsKLSAgICBpbnQgICAgICAgICBpLCBqLCBrOworCWhkd19pbmZvX3QgKmhpOworCWNpX3QgICAgICAgKmNpOworCXN0cnVjdCBuZXRfZGV2aWNlICpuZGV2OworCWludCAgICAgICAgIGksIGosIGs7CiAKLSAgICBmb3IgKGkgPSAwLCBoaSA9IGhkd19pbmZvOyBpIDwgTUFYX0JPQVJEUzsgaSsrLCBoaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGhpLT5uZGV2KSAgICAgICAgICAgICAgIC8qIGEgYm9hcmQgaGFzIGJlZW4gYXR0YWNoZWQgKi8KLSAgICAgICAgewotICAgICAgICAgICAgY2kgPSAoY2lfdCAqKShuZXRkZXZfcHJpdihoaS0+bmRldikpOwotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGNpLT5tYXhfcG9ydDsgaisrKQotICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBNVVNZQ0NfTkNIQU5TOyBrKyspCi0gICAgICAgICAgICAgICAgICAgIGlmICgobmRldiA9IGNpLT5wb3J0W2pdLmNoYW5ba10tPnVzZXIpKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkb19kZWx1c2VyIChuZGV2LCAwKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQorCWZvciAoa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KykKICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKGNoID0gY2ktPnBvcnRbcG9ydG51bV0uY2hhbltnY2hhbl0pKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChjaC0+c3RhdGUgIT0gVU5BU1NJR05FRCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIChjaC0+Y2hhbm51bSA9PSBjaGFubnVtKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjaDsKLSAgICAgICAgICAgICAgICB9CisJCWNoID0gY2ktPnBvcnRbcG9ydG51bV0uY2hhbltnY2hhbl07CisJCWlmIChjaCkgeworCQkJaWYgKChjaC0+c3RhdGUgIT0gVU5BU1NJR05FRCkgJiYKKwkJCSAgIChjaC0+Y2hhbm51bSA9PSBjaGFubnVtKSkKKwkJCQlyZXR1cm4gY2g7CisJCX0KICAgICAgICAgICAgIH0KICAgICByZXR1cm4gTlVMTDsKIH0KQEAgLTY2OCw4ICs2NjgsOSBAQAogICAgIHN0YXR1c190ICAgIHJldDsKIAogICAgIC8qIFBPUlQgUE9JTlQ6IHRoaXMgcm91dGluZSBnZW5lcmF0ZXMgZmlyc3QgaW50ZXJydXB0ICovCi0gICAgaWYgKChyZXQgPSBtdXN5Y2NfaW5pdCAoY2kpKSAhPSBTQkVfRFJWUl9TVUNDRVNTKQotICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IG11c3ljY19pbml0KGNpKTsKKwlpZiAocmV0ICE9IFNCRV9EUlZSX1NVQ0NFU1MpCisJCXJldHVybiByZXQ7CiAKICNpZiAwCiAgICAgY2ktPnAuZnJhbWluZ190eXBlID0gRlJBTUlOR19DQlA7CkBAIC03NTYsNyArNzU3LDcgQEAKICAgICB2b2xhdGlsZSB1X2ludDMyX3QgZGF0YTsKIAogICAgIGlmIChwcC0+cG9ydG51bSA+PSBjaS0+bWF4X3BvcnQpLyogc2FuaXR5IGNoZWNrICovCi0gICAgICAgIHJldHVybiBFTlhJTzsKKyAgICAgICAgcmV0dXJuIC1FTlhJTzsKIAogICAgIGNvbWV0ID0gY2ktPnBvcnRbcHAtPnBvcnRudW1dLmNvbWV0YmFzZTsKICAgICBkYXRhID0gcGNpX3JlYWRfMzIgKCh1X2ludDMyX3QgKikgY29tZXQgKyBwcC0+cG9ydF9tb2RlKSAmIDB4ZmY7CkBAIC04NDUsNyArODQ2LDcgQEAKICAgICAgKi8KICAgICBwb3J0bnVtID0gKG1jcC0+b2Zmc2V0ICUgMHg2MDAwKSAvIDB4ODAwOwogICAgIGlmIChwb3J0bnVtID49IGNpLT5tYXhfcG9ydCkKLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogICAgIHBpID0gJmNpLT5wb3J0W3BvcnRudW1dOwogICAgIGlmIChtY3AtPm9mZnNldCA+PSAweDYwMDApCiAgICAgICAgIG9mZnNldCArPSAweDYwMDA7ICAgICAgICAgICAvKiBwdXQgYmFjayBpbiBNc2dDZmdEZXNjIGFkZHJlc3Mgb2Zmc2V0ICovCkBAIC04OTQsNyArODk1LDcgQEAKIGM0X2dldF9wb3J0IChjaV90ICpjaSwgaW50IHBvcnRudW0pCiB7CiAgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgU0RfU0VNX1RBS0UgKCZjaS0+c2VtX3dkYnVzeSwgIl93ZF8iKTsgICAgICAvKiBvbmx5IDEgdGhydSBoZXJlLCBwZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGJvYXJkICovCkBAIC05MTUsNyArOTE2LDcgQEAKICAgICBpbnQgICAgICAgICBpOwogCiAgICAgaWYgKHBvcnRudW0gPj0gY2ktPm1heF9wb3J0KSAgICAvKiBzYW5pdHkgY2hlY2sgKi8KLSAgICAgICAgcmV0dXJuIEVOWElPOworICAgICAgICByZXR1cm4gLUVOWElPOwogCiAgICAgcGkgPSAmY2ktPnBvcnRbcG9ydG51bV07CiAgICAgcHAgPSAmY2ktPnBvcnRbcG9ydG51bV0ucDsKQEAgLTkyNywxNSArOTI4LDE1IEBACiAgICAgICAgICAgICAgICAgcG9ydG51bSwgZTFtb2RlLCBwaS0+b3BlbmNoYW5zKTsKICAgICB9CiAgICAgaWYgKHBpLT5vcGVuY2hhbnMpCi0gICAgICAgIHJldHVybiBFQlVTWTsgICAgICAgICAgICAgICAvKiBncm91cCBuZWVkcyBpbml0aWFsaXphdGlvbiBvbmx5IGZvcgorICAgICAgICByZXR1cm4gLUVCVVNZOyAgICAgICAgICAgICAgIC8qIGdyb3VwIG5lZWRzIGluaXRpYWxpemF0aW9uIG9ubHkgZm9yCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBmaXJzdCBjaGFubmVsIG9mIGEgZ3JvdXAgKi8KIAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gYzRfd3FfcG9ydF9pbml0IChwaSkpKSAgICAgICAvKiBjcmVhdGUvaW5pdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogd29ya3F1ZXVlX3N0cnVjdCAqLwotICAgICAgICAgICAgcmV0dXJuIHJldDsKKwlyZXQgPSBjNF93cV9wb3J0X2luaXQocGkpOworCWlmIChyZXQpICAgICAgIC8qIGNyZWF0ZS9pbml0IHdvcmtxdWV1ZV9zdHJ1Y3QgKi8KKwkJcmV0dXJuIHJldDsKICAgICB9CiAKICAgICBpbml0X2NvbWV0IChjaSwgcGktPmNvbWV0YmFzZSwgcHAtPnBvcnRfbW9kZSwgMSAvKiBjbG9ja21hc3RlciA9PSB0cnVlICovICwgcHAtPnBvcnRQKTsKQEAgLTEwMTgsMTAgKzEwMTksMTAgQEAKICAgICBpbnQgICAgICAgICBnY2hhbjsKIAogICAgIGlmIChjNF9maW5kX2NoYW4gKGNoYW5udW0pKSAgICAgLyogYSBuZXcgY2hhbm5lbCBzaG91bGRuJ3QgYWxyZWFkeSBleGlzdCAqLwotICAgICAgICByZXR1cm4gRUVYSVNUOworICAgICAgICByZXR1cm4gLUVFWElTVDsKIAogICAgIGlmIChwb3J0bnVtID49IGNpLT5tYXhfcG9ydCkgICAgLyogc2FuaXR5IGNoZWNrICovCi0gICAgICAgIHJldHVybiBFTlhJTzsKKyAgICAgICAgcmV0dXJuIC1FTlhJTzsKIAogICAgIHBpID0gJihjaS0+cG9ydFtwb3J0bnVtXSk7CiAgICAgLyogZmluZCBhbnkgYXZhaWxhYmxlIGNoYW5uZWwgd2l0aGluIHRoaXMgcG9ydCAqLwpAQCAtMTAzMiw3ICsxMDMzLDcgQEAKICAgICAgICAgICAgIGJyZWFrOwogICAgIH0KICAgICBpZiAoZ2NoYW4gPT0gTVVTWUNDX05DSEFOUykgICAgIC8qIGV4aGF1c3RlZCB0YWJsZSwgYWxsIHdlcmUgYXNzaWduZWQgKi8KLSAgICAgICAgcmV0dXJuIEVORklMRTsKKyAgICAgICAgcmV0dXJuIC1FTkZJTEU7CiAKICAgICBjaC0+dXAgPSBwaTsKIApAQCAtMTA1NSw4ICsxMDU2LDkgQEAKICAgICB7CiAgICAgICAgIHN0YXR1c190ICAgIHJldDsKIAotICAgICAgICBpZiAoKHJldCA9IGM0X3drX2NoYW5faW5pdCAocGksIGNoKSkpCi0gICAgICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IGM0X3drX2NoYW5faW5pdChwaSwgY2gpOworCWlmIChyZXQpCisJCXJldHVybiByZXQ7CiAgICAgfQogCiAgICAgLyogc2F2ZSBvZmYgaW50ZXJmYWNlIGFzc2lnbm1lbnRzIHdoaWNoIGJvdW5kIGEgYm9hcmQgKi8KQEAgLTEwNzksOCArMTA4MSwxMCBAQAogewogICAgIG1jaF90ICAgICAgKmNoOwog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RUlOVkFMOwogI2VuZGlmCiAKICAgICBpZiAoIShjaC0+dXAtPmdyb3VwX2lzX3NldCkpCiAgICAgewotICAgICAgICByZXR1cm4gRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCisgICAgICAgIHJldHVybiAtRUlPOyAgICAgICAgICAgICAgICAgLyogb3V0IG9mIG9yZGVyLCBTRVRfUE9SVCBjb21tYW5kCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZXF1aXJlZCBwcmlvciB0byBmaXJzdCBncm91cCdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBTRVRfQ0hBTiBjb21tYW5kICovCiAgICAgfQpAQCAtMTE0MywxMCArMTE0OSwxMiBAQAogICAgIHsKICAgICAgICAgc3RhdHVzX3QgICAgcmV0OwogCi0gICAgICAgIGlmICgocmV0ID0gbXVzeWNjX2NoYW5fZG93biAoKGNpX3QgKikgMCwgY2hhbm51bSkpKQotICAgICAgICAgICAgcmV0dXJuIHJldDsKLSAgICAgICAgaWYgKChyZXQgPSBjNF9jaGFuX3VwIChjaC0+dXAtPnVwLCBjaGFubnVtKSkpCi0gICAgICAgICAgICByZXR1cm4gcmV0OworCXJldCA9IG11c3ljY19jaGFuX2Rvd24oKGNpX3QgKikwLCBjaGFubnVtKTsKKwlpZiAocmV0KQorCQlyZXR1cm4gcmV0OworCXJldCA9IGM0X2NoYW5fdXAoY2gtPnVwLT51cCwgY2hhbm51bSk7CisJaWYgKHJldCkKKwkJcmV0dXJuIHJldDsKICAgICAgICAgc2RfZW5hYmxlX3htaXQgKGNoLT51c2VyKTsgIC8qIHJlLWVuYWJsZSB0byBjYXRjaCBmbG93IGNvbnRyb2xsZWQKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGNoYW5uZWwgKi8KICAgICB9CkBAIC0xMTU5LDggKzExNjcsMTAgQEAKIHsKICAgICBtY2hfdCAgICAgICpjaDsKIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICAqcCA9IGNoLT5wOwogICAgIHJldHVybiAwOwogfQpAQCAtMTE3MCw4ICsxMTgwLDEwIEBACiB7CiAgICAgbWNoX3QgICAgICAqY2g7CiAKLSAgICBpZiAoIShjaCA9IGM0X2ZpbmRfY2hhbiAoY2hhbm51bSkpKQotICAgICAgICByZXR1cm4gRU5PRU5UOworCWNoID0gYzRfZmluZF9jaGFuKGNoYW5udW0pOworCWlmICghY2gpCisJCXJldHVybiAtRU5PRU5UOworCiAgICAgKnAgPSBjaC0+czsKICAgICBwLT50eF9wZW5kaW5nID0gYXRvbWljX3JlYWQgKCZjaC0+dHhfcGVuZGluZyk7CiAgICAgcmV0dXJuIDA7CkBAIC0xMjQwLDggKzEyNTIsMTAgQEAKICAgICB1X2ludDMyX3QgICB0bXA7ICAgICAgICAgICAgLyogZm9yIG9wdGltaXppbmcgY29udmVyc2lvbiBhY3Jvc3MgQkUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcGxhdGZvcm0gKi8KIAotICAgIGlmICghKGNoID0gYzRfZmluZF9jaGFuIChjaGFubnVtKSkpCi0gICAgICAgIHJldHVybiBFTk9FTlQ7CisJY2ggPSBjNF9maW5kX2NoYW4oY2hhbm51bSk7CisJaWYgKCFjaCkKKwkJcmV0dXJuIC1FTk9FTlQ7CisKICAgICBpZiAoY2gtPnN0YXRlID09IFVQKQogICAgIHsKICAgICAgICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCkBAIC0xMjY0LDcgKzEyNzgsNyBAQAogICAgICAgICAgICAgICAgIHByX2luZm8oIisgYXNrNCAleCwgY3VycmVudGx5ICV4XG4iLAogICAgICAgICAgICAgICAgICAgICAgICAgY2gtPnAuYml0bWFza1tpXSwgcGktPnRzbVtpXSk7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gRUlOVkFMOworICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7CiAgICAgICAgIH0KICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKICAgICAgICAgICAgIGlmIChjaC0+cC5iaXRtYXNrW2ldICYgKDEgPDwgaikpCkBAIC0xMjc3LDcgKzEyOTEsNyBAQAogICAgICAgICAvKiBpZiggY3h0MWUxX2xvZ19sZXZlbCA+PSBMT0dfV0FSTikgICovCiAgICAgICAgIHByX2luZm8oIiVzOiBjNF9jaGFuX3VwWyVkXSBFTk9CVUZTIChubyBUaW1lU2xvdHMgYXNzaWduZWQpXG4iLAogICAgICAgICAgICAgICAgIGNpLT5kZXZuYW1lLCBjaGFubnVtKTsKLSAgICAgICAgcmV0dXJuIEVOT0JVRlM7ICAgICAgICAgICAgIC8qIHRoaXMgc2hvdWxkIG5vdCBoYXBwZW4gKi8KKyAgICAgICAgcmV0dXJuIC1FTk9CVUZTOyAgICAgICAgICAgICAvKiB0aGlzIHNob3VsZCBub3QgaGFwcGVuICovCiAgICAgfQogICAgIGFkZHIgPSBjNF9maWZvX2FsbG9jIChwaSwgZ2NoYW4sICZuYnVmKTsKICAgICBjaC0+c3RhdGUgPSBVUDsKQEAgLTEzNzIsMTIgKzEzODYsMTMgQEAKICAgICAgICAgfQogICAgICAgICBtZC0+bmV4dCA9IGNwdV90b19sZTMyIChPU192dG9waHlzIChtZC0+c25leHQpKTsKIAotICAgICAgICAgICAgICAgaWYgKCEobSA9IE9TX21lbV90b2tlbl9hbGxvYyAoY3h0MWUxX21heF9tcnUpKSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGN4dDFlMV9sb2dfbGV2ZWwgPj0gTE9HX01PTklUT1IpCi0gICAgICAgICAgICAgICAgcHJfaW5mbygiJXM6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ZXJydXB0IHN0cnVjdHMvZGVmaW5lcyAqLworI2luY2x1ZGUgPGxpbnV4L2N0eXBlLmg+CisjaW5jbHVkZSA8bGludXgvdHR5Lmg+CisjaW5jbHVkZSA8bGludXgvdHR5X2ZsaXAuaD4KKyNpbmNsdWRlIDxsaW51eC9zZXJpYWxfcmVnLmg+CisjaW5jbHVkZSA8bGludXgvaW8uaD4JCS8qIEZvciByZWFkW2J3bF0vd3JpdGVbYndsXSAqLworCisjaW5jbHVkZSA8bGludXgvc3RyaW5nLmg+CisjaW5jbHVkZSA8bGludXgvZGV2aWNlLmg+CisjaW5jbHVkZSA8bGludXgva2Rldl90Lmg+CisjaW5jbHVkZSA8bGludXgvZmlybXdhcmUuaD4KKworI2luY2x1ZGUgImRnYXAuaCIKKworI2RlZmluZSBpbml0X01VVEVYKHNlbSkgICAgICAgICBzZW1hX2luaXQoc2VtLCAxKQorI2RlZmluZSBERUNMQVJFX01VVEVYKG5hbWUpICAgICBcCisJc3RydWN0IHNlbWFwaG9yZSBuYW1lID0gX19TRU1BUEhPUkVfSU5JVElBTElaRVIobmFtZSwgMSkKKworTU9EVUxFX0xJQ0VOU0UoIkdQTCIpOworTU9EVUxFX0FVVEhPUigiRGlnaSBJbnRlcm5hdGlvbmFsLCBodHRwOi8vd3d3LmRpZ2kuY29tIik7CitNT0RVTEVfREVTQ1JJUFRJT04oIkRyaXZlciBmb3IgdGhlIERpZ2kgSW50ZXJuYXRpb25hbCBFUENBIFBDSSBiYXNlZCBwcm9kdWN0IGxpbmUiKTsKK01PRFVMRV9TVVBQT1JURURfREVWSUNFKCJkZ2FwIik7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIHByb3RvcyBmb3IgdGhpcyBmaWxlCisgKgorICovCisKK3N0YXRpYyBpbnQgZGdhcF9zdGFydCh2b2lkKTsKK3N0YXRpYyB2b2lkIGRnYXBfaW5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ICAgICBBY2NlbGVwb3J0IEVQQy9YICAgICAgICAgOCAtIDIyNCAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IFhyLzQyMiAgICAgICAgNCAmIDggICAgICAgICAgICAgICAoRUlBNDIyKQorICAgICBBY2NlbGVwb3J0IDJyLzkyMCAgICAgICAgMiAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IDRyLzkyMCAgICAgICAgNCAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorICAgICBBY2NlbGVwb3J0IDhyLzkyMCAgICAgICAgOCAgICAgICAgICAgICAgICAgICAoRUlBMjMyKQorCisgICAgIElCTSA4LVBvcnQgQXN5bmNocm9ub3VzIFBDSSBBZGFwdGVyICAgICAgICAgIChFSUEyMzIpCisgICAgIElCTSAxMjgtUG9ydCBBc3luY2hyb25vdXMgUENJIEFkYXB0ZXIgICAgICAgIChFSUEyMzIgJiBFSUE0MjIpCisqLworCitzdGF0aWMgc3RydWN0IHBjaV9kZXZpY2VfaWQgZGdhcF9wY2lfdGJsW10gPSB7CisJeyBESUdJX1ZJRCwgUENJX0RFVl9YRU1fRElELCAgICAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICAwIH0sCisJeyBESUdJX1ZJRCwgUENJX0RFVl9DWF9ESUQsICAgICAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICAxIH0sCisJeyBESUdJX1ZJRCwgUENJX0RFVl9DWF9JQk1fRElELCAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICAyIH0sCisJeyBESUdJX1ZJRCwgUENJX0RFVl9FUENKX0RJRCwgICAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICAzIH0sCisJeyBESUdJX1ZJRCwgUENJX0RFVl85MjBfMl9ESUQsICAgIFBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDAsIDAsICA0IH0sCisJeyBESUdJX1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LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqCisqIEZ1bmN0aW9uOgorKgorKiAgICBkZ2FwX3BvbGxfaGFuZGxlcgorKgorKiBBdXRob3I6CisqCisqICAgIFNjb3R0IEggS2lsYXUKKyoKKyogUGFyYW1ldGVyczoKKyoKKyogICAgZHVtbXkgLS0gaWdub3JlZAorKgorKiBSZXR1cm4gVmFsdWVzOgorKgorKiAgICBub25lCisqCisqIERlc2NyaXB0aW9uOgorKgorKiAgICBBcyBlYWNoIHRpbWVyIGV4cGlyZXMsIGl0IGRldGVybWluZXMgKGEpIHdoZXRoZXIgdGhlICJ0cmFuc21pdCIKKyogICAgd2FpdGVyIG5lZWRzIHRvIGJlIHdva2VuIHVwLCBhbmQgKGIpIHdoZXRoZXIgdGhlIHBvbGxlciBuZWVkcyB0bworKiAgICBiZSByZXNjaGVkdWxlZC4KKyoKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQgZGdhcF9wb2xsX2hhbmRsZXIodWxvbmcgZHVtbXkpCit7CisJaW50IGk7CisJc3RydWN0IGJvYXJkX3QgKmJyZDsKKwl1bnNpZ25lZCBsb25nIGxvY2tfZmxhZ3M7CisJdWxvbmcgbmV3X3RpbWU7CisKKwlkZ2FwX3BvbGxfY291bnRlcisrOworCisJLyoKKwkgKiBEbyBub3Qgc3RhcnQgdGhlIGJvYXJkIHN0YXRlIG1hY2hpbmUgdW50aWwKKwkgKiBkcml2ZXIgdGVsbHMgdXMgaXRzIHVwIGFuZCBydW5uaW5nLCBhbmQgaGFzCisJICogZXZlcnl0aGluZyBpdCBuZWVkcy4KKwkgKi8KKwlpZiAoZGdhcF9kcml2ZXJfc3RhdGUgIT0gRFJJVkVSX1JFQURZKQorCQlnb3RvIHNjaGVkdWxlX3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8qCisJICogU2NoZWR1bGUgdGFza2xldCB0byBydW4gYXQgYSBiZXR0ZXIgdGltZS4KKwkgKi8KKwl0YXNrbGV0X3NjaGVkdWxlKCZicmQtPmhlbHBlcl90YXNrbGV0KTsKKwlyZXR1cm4gSVJRX0hBTkRMRUQ7Cit9CisKKy8qCisgKiBkZ2FwX2luaXRfZ2xvYmFscygpCisgKgorICogVGhpcyBpcyB3aGVyZSB3ZSBpbml0aWFsaXplIHRoZSBnbG9iYWxzIGZyb20gdGhlIHN0YXRpYyBpbnNtb2QKKyAqIGNvbmZpZ3VyYXRpb24gdmFyaWFibGVzLiAgVGhlc2UgYXJlIGRlY2xhcmVkIG5lYXIgdGhlIGhlYWQgb2YKKyAqIHRoaXMgZmlsZS4KKyAqLworc3RhdGljIHZvaWQgZGdhcF9pbml0X2dsb2JhbHModm9pZCkKK3sKKwlpbnQgaSA9IDA7CisKKwlmb3IgKGkgPSAwOyBpIDwgTUFYQk9BUkRTOyBpKyspCisJCWRnYXBfQm9hcmRbaV0gPSBOVUxMOworCisJaW5pdF90aW1lcigmZGdhcF9wb2xsX3RpbWVyKTsKKworCWluaXRfd2FpdHF1ZXVlX2hlYWQoJmRnYXBfZGxfd2FpdCk7CisJZGdhcF9kbF9hY3Rpb24gPSAwOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogVXRpbGl0eSBmdW5jdGlvbnMKKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogZGdhcF9tc19zbGVlcCgpCisgKgorICogUHV0IHRoZSBkcml2ZXIgdG8gc2xlZXAgZm9yIHggbXMncworICoKKyAqIFJldHVybnMgMCBpZiB0aW1lZCBvdXQsICEwIChzaG93aW5nIHNpZ25hbCkgaWYgaW50ZXJydXB0ZWQgYnkgYSBzaWduYWwuCisgKi8KK3N0YXRpYyBpbnQgZGdhcF9tc19zbGVlcCh1bG9uZyBtcykKK3sKKwljdXJyZW50LT5zdGF0ZSA9IFRBU0tfSU5URVJSVVBUSUJMRTsKKwlzY2hlZHVsZV90aW1lb3V0KChtcyAqIEhaKSAvIDEwMDApOworCXJldHVybiBzaWduYWxfcGVuZGluZyhjdXJyZW50KTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFRUWSBJbml0aWFsaXphdGlvbi9DbGVhbnVwIEZ1bmN0aW9ucworICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBkZ2FwX3R0eV9yZWdpc3RlcigpCisgKgorICogSW5pdCB0aGUgdHR5IHN1YnN5c3RlbSBmb3IgdGhpcyBib2FyZC4KKyAqLworc3RhdGljIGludCBkZ2FwX3R0eV9yZWdpc3RlcihzdHJ1Y3QgYm9hcmRfdCAqYnJkKQoreworCWludCByYyA9IDA7CisKKwlicmQtPlNlcmlhbERyaXZlciA9IGFsbG9jX3R0eV9kcml2ZXIoTUFYUE9SVFMpOworCisJc25wcmludGYoYnJkLT5TZXJpYWxOYW1lLCBNQVhUVFlOQU1FTEVOLCAidHR5X2RnYXBfJWRfIiwgYnJkLT5ib2FyZG51bSk7CisJYnJkLT5TZXJpYWxEcml2ZXItPm5hbWUgPSBicmQtPlNlcmlhbE5hbWU7CisJYnJkLT5TZXJpYWxEcml2ZXItPm5hbWVfYmFzZSA9IDA7CisJYnJkLT5TZXJpYWxEcml2ZXItPm1ham9yID0gMDsKKwlicmQtPlNlcmlhbERyaXZlci0+bWlub3Jfc3RhcnQgPSAwOworCWJyZC0+U2VyaWFsRHJpdmVyLT50eXBlID0gVFRZX0RSSVZFUl9UWVBFX1NFUklBTDsKKwlicmQtPlNlcmlhb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AgPSB0bXBidWY7CisJCQl0bXBidWZsZW4gPSAwOworCQl9CisKKwl9IHdoaWxlICh0b29fbXVjaF9kYXRhKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9pbnB1dCAtIFByb2Nlc3MgcmVjZWl2ZWQgZGF0YS4KKyAqCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCisKK3N0YXRpYyB2b2lkIGRnYXBfaW5wdXQoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCXN0cnVjdCBic190CSpiczsKKwlzdHJ1Y3QgdHR5X3N0cnVjdCAqdHA7CisJc3RydWN0IHR0eV9sZGlzYyAqbGQ7CisJdWludAlybWFzazsKKwl1aW50CWhlYWQ7CisJdWludAl0YWlsOworCWludAlkYXRhX2xlbjsKKwl1bG9uZwlsb2NrX2ZsYWdzOworCXVsb25nICAgbG9ja19mbGFnczI7CisJaW50IGZsaXBfbGVuOworCWludCBsZW4gPSAwOworCWludCBuID0gMDsKKwl1Y2hhciAqYnVmOworCXVjaGFyIHRtcGNoYXI7CisJaW50IHMgPSAwOworCisJaWYgKCFjaCB8fCBjaC0+bWFnaWMgIT0gREdBUF9DSEFOTkVMX01BR0lDKQorCQlyZXR1cm47CisKKwl0cCA9IGNoLT5jaF90dW4udW5fdHR5OworCisJYnMgID0gY2gtPmNoX2JzOworCWlmICghYnMpCisJCXJldHVybjsKKworCWJkID0gY2gtPmNoX2JkOworCWlmICghYmQgfHwgYmQtPm1hZ2ljICE9IERHQVBfQk9BUkRfTUFHSUMpCisJCXJldHVybjsKKworCXNwaW5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IHR0eSBsYXllciBpdHMgb2theSB0byAiZWF0IiB0aGUgZGF0YSBub3cgKi8KKwl0dHlfZmxpcF9idWZmZXJfcHVzaCh0cC0+cG9ydCk7CisKKwlpZiAobGQpCisJCXR0eV9sZGlzY19kZXJlZihsZCk7CisKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRGV0ZXJtaW5lcyB3aGVuIENBUlJJRVIgY2hhbmdlcyBzdGF0ZSBhbmQgdGFrZXMgYXBwcm9wcmlhdGUKKyAqIGFjdGlvbi4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgdm9pZCBkZ2FwX2NhcnJpZXIoc3RydWN0IGNoYW5uZWxfdCAqY2gpCit7CisJc3RydWN0IGJvYXJkX3QgKmJkOworCisJaW50IHZpcnRfY2FycmllciA9IDA7CisJaW50IHBoeXNfY2FycmllciA9IDA7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyAhPSBER0FQX0NIQU5ORUxfTUFHSUMpCisJCXJldHVybjsKKworCWJkID0gY2gtPmNoX2JkOworCisJaWYgKCFiZCB8fCBiZC0+bWFnaWMgIT0gREdBUF9CT0FSRF9NQUdJQykKKwkJcmV0dXJuOworCisJLyogTWFrZSBzdXJlIGFsdHBpbiBpcyBhbHdheXMgc2V0IGNvcnJlY3RseSAqLworCWlmIChjaC0+Y2hfZGlnaS5kaWdpX2ZsYWdzICYgRElHSV9BTFRQSU4pIHsKKwkJY2gtPmNoX2RzciAgICAgID0gRE1fQ0Q7CisJCWNoLT5jaF9jZCAgICAgICA9IERNX0RTUjsKKwl9IGVsc2UgeworCQljaC0+Y2hfZHNyICAgICAgPSBETV9EU1I7CisJCWNoLT5jaF9jZCAgICAgICA9IERNX0NEOworCX0KKworCWlmIChjaC0+Y2hfbWlzdGF0ICYgR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3RvcmUoJmJkLT5iZF9sb2NrLCBsb2NrX2ZsYWdzKTsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWRiIC0gU2VuZHMgYSAyIGJ5dGUgY29tbWFuZCB0byB0aGUgRkVQLgorICoKKyAqICAgICAgICAgICAgICBjaCAgICAgIC0gUG9pbnRlciB0byBjaGFubmVsIHN0cnVjdHVyZS4KKyAqICAgICAgICAgICAgICBjbWQgICAgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUxICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgZmlyc3QgYnl0ZSB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIGJ5dGUyICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgc2Vjb25kIGJ5dGUgdG8gYmUgc2VudC4KKyAqICAgICAgICAgICAgICBuY21kcyAgIC0gV2FpdCB1bnRpbCBuY21kcyBvciBmZXdlciBjbWRzIGFyZSBsZWZ0CisgKiAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBjbWQgYnVmZmVyIGJlZm9yZSByZXR1cm5pbmcuCisgKgorICo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCitzdGF0aWMgdm9pZCBkZ2FwX2NtZGIoc3RydWN0IGNoYW5uZWxfdCAqY2gsIHVjaGFyIGNtZCwgdWNoYXIgYnl0ZTEsCisJCQl1Y2hhciBieXRlMiwgdWludCBuY21kcykKK3sKKwljaGFyCQkqdmFkZHIgPSBOVUxMOworCXN0cnVjdCBjbV90CSpjbV9hZGRyID0gTlVMTDsKKwl1aW50CQljb3VudDsKKwl1aW50CQluOworCXUxNgkJaGVhZDsKKwl1MTYJCXRhaWw7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyA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AgIC0gQ29tbWFuZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIHdvcmQgICAgLSBJbnRlZ2VyIGNvbnRhaW5pbmcgd29yZCB0byBiZSBzZW50LgorICogICAgICAgICAgICAgIG5jbWRzICAgLSBXYWl0IHVudGlsIG5jbWRzIG9yIGZld2VyIGNtZHMgYXJlIGxlZnQKKyAqICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGNtZCBidWZmZXIgYmVmb3JlIHJldHVybmluZy4KKyAqCisgKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KK3N0YXRpYyB2b2lkIGRnYXBfY21kdyhzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdWNoYXIgY21kLCB1MTYgd29yZCwgdWludCBuY21kcykKK3sKKwljaGFyCQkqdmFkZHIgPSBOVUxMOworCXN0cnVjdCBjbV90CSpjbV9hZGRyID0gTlVMTDsKKwl1aW50CQljb3VudDsKKwl1aW50CQluOworCXUxNgkJaGVhZDsKKwl1MTYJCXRhaWw7CisKKwlpZiAoIWNoIHx8IGNoLT5tYWdpYyAhPSBER0FQX0NIQU5ORUxfTUFHSUMpCisJCXJldHVybjsKKworCS8qCisJICogQ2hlY2sgaWYgYm9hcmQgaXMgc3RpbGwgYWxpdmUuCisJICovCisJaWYgKGNoLT5jaF9iZC0+c3RhdGUgPT0gQk9BUkRfRkFJTEVEKQorCQlyZXR1cm47CisKKwkvKgorCSAqIE1ha2Ugc3VyZSB0aGUgcG9pbnRlcnMgYXJlIGluIHJhbmdlIGJlZm9yZQorCSAqIHdyaXRpbmcgdG8gdGhlIEZFUCBtZW1vcnkuCisJICovCisJdmFkZHIgPSBjaC0+Y2hfYmQtPnJlX21hcF9tZW1iYXNlOworCWlmICghdmFkZHIpCisJCXJldHVybjsKKworCWNtX2FkZHIgPSAoc3RydWN0IGNtX3QgKikgKHZhZGRyICsgQ01EQlVGKTsKKwloZ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YoY21fYWRkci0+Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9jbWR3X2V4dCAtIFNlbmRzIGEgZXh0ZW5kZWQgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCisgKgorICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgorICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCisgKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAorICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGdhcF9jbWR3X2V4dChzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdTE2IGNtZCwgdTE2IHdvcmQsIHVpbnQgbmNtZHMpCit7CisJY2hhcgkJKnZhZGRyID0gTlVMTDsKKwlzdH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Y21fdGFpbCkpOworCisJCW4gPSAoaGVhZCAtIHRhaWwpICYgKENNRE1BWCAtIENNRFNUQVJUIC0gNCk7CisKKwkJaWYgKG4gPD0gbmNtZHMgKiBzaXplb2Yoc3RydWN0IGNtX3QpKQorCQkJYnJlYWs7CisKKwkJaWYgKC0tY291bnQgPT0gMCkgeworCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKKwkJCXJldHVybjsKKwkJfQorCQl1ZGVsYXkoMTApOworCX0KK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF93bW92ZSAtIFdyaXRlIGRhdGEgdG8gRkVQIGJ1ZmZlci4KKyAqCisgKiAgICAgICAgICAgICAgY2ggICAgICAtIFBvaW50ZXIgdG8gY2hhbm5lbCBzdHJ1Y3R1cmUuCisgKiAgICAgICAgICAgICAgYnVmICAgICAtIFBvaXRlciB0byBjaGFyYWN0ZXJzIHRvIGJlIG1vdmVkLgorICogICAgICAgICAgICAgIGNudCAgICAgLSBOdW1iZXIgb2YgY2hhcmFjdGVycyB0byBtb3ZlLgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIHZvaWQgZGdhcF93bW92ZShzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgY2hhciAqYnVmLCB1aW50IGNudCkKK3sKKwlpbnQgICAgbjsKKwljaGFyICAgKnRhZGRyOworCXN0cnVjdCBic190ICAgICpiczsKKwl1MTYgICAgaGVhZDsKKworCWlmICghY2ggfHwgY2gtPm1hZ2ljICE9IERHQVBfQ0hBTk5FTF9NQUdJQykKKwkJcmV0dXJuOworCisJLyoKKwkgKiBDaGVjayBwYXJhbWV0ZXJzLgorCSAqLworCWJzICAgPSBjaC0+Y2hfYnM7CisJaGVhZ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2Ugc3VyZQorCSAqIGFsbCB0aGUgY3VycmVudCBzZXR0aW5ncyBnZXQgcmVhcHBsaWVkIHRvIHRoZSBwb3J0CisJICogaW4gdGhlIGZpcm13YXJlLgorCSAqCisJICogU28gd2Ugd2lsbCBzZXQgdGhlIGRyaXZlcidzIGNhY2hlIG9mIGZpcm13YXJlCisJICogc2V0dGluZ3MgYWxsIHRvIDAsIGFuZCB0aGVuIGNhbGwgcGFyYW0uCisJICovCisJY2gtPmNoX2ZlcGlmbGFnID0gMDsKKwljaC0+Y2hfZmVwY2ZsYWcgPSAwOworCWNoLT5jaF9mZXBvZmxhZyA9IDA7CisJY2gtPmNoX2ZlcHN0YXJ0YyA9IDA7CisJY2gtPmNoX2ZlcHN0b3BjID0gMDsKKwljaC0+Y2hfZmVwYXN0YXJ0YyA9IDA7CisJY2gtPmNoX2ZlcGFzdG9wYyA9IDA7CisJY2gtPmNoX21vc3RhdCA9IDA7CisJY2gtPmNoX2hmbG93ID0gMDsKK30KKworLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICoKKyAqICAgICAgZGdhcF9wYXJhbSAtIFNldCBEaWdpIHBhcmFtZXRlcnMuCisgKgorICogICAgICAgICAgICAgIHN0cnVjdCB0dHlfc3RydWN0ICogICAgIC0gVFRZIGZvciBwb3J0LgorICoKKyAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLworc3RhdGljIGludCBkZ2FwX3BhcmFtKHN0cnVjdCB0dHlfc3RydWN0ICp0dHkpCit7CisJc3RydWN0IGt0ZXJtaW9zICp0czsKKwlzdHJ1Y3QgYm9hcmRfdCAqYmQ7CisJc3RydWN0IGNoYW5uZWxfdCAqY2g7CisJc3RydWN0IGJzX3QgICAqYnM7CisJc3RydWN0IHVuX3QgICAqdW47CisJdTE2CWhlYWQ7CisJdTE2CWNm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B2YXJpb3VzIHR0eSBzdHJ1Y3RzL2RlZmluZXMgKi8KKyNpbmNsdWRlIDxsaW51eC9pbnRlcnJ1cHQuaD4gICAgLyogRm9yIGlycXJldHVybl90IHR5cGUgKi8KKworI2lmbmRlZiBUUlVFCisjIGRlZmluZSBUUlVFIDEKKyNlbmRpZgorCisjaWZuZGVmIEZBTFNFCisjIGRlZmluZSBGQUxTRSAwCisjZW5kaWYKKworLyogUmVxdWlyZWQgZm9yIG91ciBzaGFyZWQgaGVhZGVycyEgKi8KK3R5cGVkZWYgdW5zaWduZWQgY2hhcgkJdWNoYXI7CisKKyNpZiAhZGVmaW5lZChUVFlfRkxJUEJVRl9TSVpFKQorIyBkZWZpbmUgVFRZX0ZMSVBCVUZfU0laRSA1MTIKKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIERyaXZlciBkZWZpbmVzCisgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qCisgKiBEcml2ZXIgaWRlbnRpZmljYXRpb24KKyAqLworI2RlZmluZQlER19OQU1FCQkiZGdhcC0xLjMtMTYiCisjZGVmaW5lCURHX1BBUlQJCSI0MDAwMjM0N19DIgorI2RlZmluZQlEUlZTVFIJCSJkZ2FwIgorCisvKgorICogZGVmaW5lcyBmcm9tIGRnYXBfcGNpLmgKKyAqLyAKKyNkZWZpbmUgUENJTUFYIDMyCQkJLyogbWF4aW11bSBudW1iZXIgb2YgUENJIGJvYXJkcyAqLworCisjZGVmaW5lIERJR0lfVklECQkweDExNEYKKworI2RlZmluZSBQQ0lfREVWX0VQQ19ESUQJCTB4MDAwMgorI2RlZmluZSBQQ0lfREVWX1hFTV9ESUQJCTB4MDAwNAorI2RlZmluZSBQQ0lfREVWX1hSX0RJRAkJMHgwMDA1CisjZGVma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ZESVNBQkxFCisjZGVmaW5lICAgX1BPU0lYX1ZESVNBQkxFICdcMCcKKyNlbmRpZgorCisjZGVmaW5lIFNOSUZGX01BWAk2NTUzNgkJLyogU25pZmYgYnVmZmVyIHNpemUgKDJebikgKi8KKyNkZWZpbmUgU05JRkZfTUFTSwkoU05JRkZfTUFYIC0gMSkJLyogU25pZmYgd3JhcCBtYXNrICovCisKKyNkZWZpbmUgVlBEU0laRSAoNTEyKQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIEZFUCBtZW1vcnkgb2Zmc2V0cworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgU1RBUlQgICAgICAgICAgIDB4MDAwNEwgICAgICAgICAvKiBFeGVjdXRpb24gc3RhcnQgYWRkcmVzcyAgICAgICovCisKKyNkZWZpbmUgQ01EQlVGICAgICAgICAgIDB4MGQxMEwgICAgICAgICAvKiBDb21tYW5kIChjbV90KSBzdHJ1Y3R1cmUgb2Zmc2V0ICovCisjZGVmaW5lIENNRFNUQVJUICAgICAgICAweDA0MDBMICAgICAgICAgLyogU3RhcnQgb2YgY29tbWFuZCBidWZmZXIgICAgICAqLworI2RlZmluZSBDTURNQVggICAgICAgICAgMHgwODAwTCAgICAgICAgIC8qIEVuZCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICAgKi8KKworI2RlZmluZSBFVkJVRiAgICAgICAgICAgMHgwZDE4TCAgICAgICAgIC8qIEV2ZW50IChldl90KSBzdHJ1Y3R1cmUgICAgICAgKi8KKyNkZWZpbmUgRVZTVEFSVCAgICAgICAgIDB4MDgwMEwgICAgICAgICAvKiBTdGFydCBvZiBldmVudCBidWZmZXIgICAgICAgICovCisjZGVmaW5lIEVWTUFYICAgICAgICAgICAweDBjMDBMICAgICAgICAgLyogRW5kIG9mIGV2ZW50IGJ1ZmZlciAgICAgICAgICAqLworI2RlZmluZSBGRVA1X1BMVVMgICAgICAgMHgwRTQwICAgICAgICAgIC8qIEFTQ0lJICc1JyBhbmQgQVNDSUkgJ0EnIGlzIGhlcmUgICovCisjZGVmaW5lIEVDU19TRUcgICAgICAgICAweDBFNDQgICAgICAgICAgLyogU2VnbWVudCBvZiB0aGUgZXh0ZW5kZWQgY2hhbm5lbCBzdHJ1Y3R1cmUgKi8KKyNkZWZpbmUgTElORV9TUEVFRCAgICAgIDB4MTAgICAgICAgICAgICAvKiBPZmZzZXQgaW50byBFQ1NfU0VHIGZvciBsaW5lIHNwZWVkICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZmVwIGhhcyBleHRlbmRlZCBjYXBhYmlsaXRpZXMgKi8KKworLyogQklPUyBNQUdJQyBTUE9UUyAqLworI2RlZmluZSBFUlJPUiAgICAgICAgICAgMHgwQzE0TAkJLyogQklPUyBlcnJvciBjb2RlICAgICAgICAgICAgICAqLworI2RlZmluZSBTRVFVRU5DRQkweDBDMTJMCQkvKiBCSU9TIHNlcXVlbmNlIGluZGljYXRvciAgICAgICovCisjZGVmaW5lIFBPU1RBUkVBCTB4MEMwMEwJCS8qIFBPU1QgY29tcGxldGUgbWVzc2FnZSBhcmVhICAgKi8KKworLyogRkVQIE1BR0lDIFNQT1RTICovCisjZGVmaW5lIEZFUFNUQVQgICAgICAgICBQT1NUQVJFQSAgICAgICAgLyogT1MgaGVyZSB3aGVuIEZFUCBjb21lcyB1cCAgICAqLworI2RlZmluZSBOQ0hBTiAgICAgICAgICAgMHgwQzAyTCAgICAgICAgIC8qIG51bWJlciBvZiBwb3J0cyBGRVAgc2VlcyAgICAgKi8KKyNkZWZpbmUgUEFOSUMgICAgICAgICAgIDB4MEMxMEwgICAgICAgICAvKiBQQU5JQyBhcmVhIGZvciBGRVAgICAgICAgICAgICovCisjZGVmaW5lIEtNRU1FTSAgICAgICAgICAweDBDMzBMICAgICAgICAgLyogTWVtb3J5IGZvciBLTUUgdXNlICAgICAgICAgICAqLworI2RlZmluZSBDT05GSUcgICAgICAgICAgMHgwQ0QwTCAgICAgICAgIC8qIENvbmNlbnRyYXRvciBjb25maWd1cmF0aW9uIGluZm8gKi8KKyNkZWZpbmUgQ09ORklHU0laRSAgICAgIDB4MDAzMCAgICAgICAgICAvKiBjb25maWd1cmF0aW9uIGluZm8gc2l6ZSAgICAgICovCisjZGVmaW5lIERPV05SRVEgICAgICAgICAweDBEMDAgICAgICAgICAgLyogRG93bmxvYWQgcmVxdWVzdCBidWZmZXIgcG9pbnRlciAqLworCisjZGVmaW5lIENIQU5CVUYgICAgICAgICAweDEwMDBMICAgICAgICAgLyogQXN5bmMgY2hhbm5lbCAoYnNfdCkgc3RydWN0cyAqLworI2RlZmluZSBGRVBPU1NJWkUgICAgICAgMHgxRkZGICAgICAgICAgIC8qIDhLIEZFUE9TICAgICAgICAgICAgICAgICAgICAgKi8KKworI2RlZmluZSBYRU1QT1JUUyAgICAweEMwMgkvKgorCQkJCSAqIE9mZnNldCBpbiBib2FyZCBtZW1vcnkgd2hlcmUgRkVQNSBzdG9yZXMKKwkJCQkgKiBob3cgbWFueSBwb3J0cyBpdCBoYXMgZGV0ZWN0ZWQuCisJCQkJICogTk9URTogRkVQNSByZXBvcnRzIDY0IHBvcnRzIHdoZW4gdGhlIHVzZXIKKwkJCQkgKiBoYXMgdGhlIGNhYmxlIGluIEVCSSBPVVQgaW5zdGVhZCBvZiBFQkkgSU4uCisJCQkJICovCisKKyNkZWZpbmUgRkVQQ0xSICAgICAgMHgwMAorI2RlZmluZSBGRVBNRU0gICAgICAweDAyCisjZGVmaW5lIEZFUFJTVCAgICAgIDB4MDQKKyNkZWZpbmUgRkVQSU5UICAgICAgMHgwOAorI2RlZmluZSBGRVBNQVNLICAgICAweDBlCisjZGVmaW5lIEZFUFdJTiAgICAgIDB4ODAKKworI2RlZmluZSBMT1dNRU0g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zQyMiBtb2RlCQkqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCU1vZGVzIGZvciBTQ09NTU9ERQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUgTU9ERV8yMzIJMHgwMAorI2RlZmluZSBNT0RFXzQyMgkweDAxCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBFdmVudCBmbGFncy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjZGVmaW5lIElGQlJFQUsgICAgICAgICAweDAxICAgICAgICAgICAgLyogQnJlYWsgcmVjZWl2ZWQgICAgICAgICAgICAgICAqLworI2RlZmluZSBJRlRMVyAgICAgICAgICAgMHgwMiAgICAgICAgICAgIC8qIFRyYW5zbWl0IGxvdyB3YXRlciAgICAgICAgICAgKi8KKyNkZWZpbmUgSUZURU0gICAgICAgICAgIDB4MDQgICAgICAgICAgICAvKiBUcmFuc21pdHRlciBlbXB0eSAgICAgICAgICAgICovCisjZGVmaW5lIElGREFUQSAgICAgICAgICAweDA4ICAgICAgICAgICAgLyogUmVjZWl2ZSBkYXRhIHByZXNlbnQgICAgICAgICAqLworI2RlZmluZSBJRk1PREVNICAgICAgICAgMHgyMCAgICAgICAgICAgIC8qIE1vZGVtIHN0YXR1cyBjaGFuZ2UgICAgICAgICAgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICBNb2RlbSBmbGFncworICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyMgICAgICAgZGVmaW5lICBETV9SVFMgICAgICAgICAgMHgwMiAgICAvKiBSZXF1ZXN0IHRvIHNlbmQgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fQ0QgICAgICAgICAgIDB4ODAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RTUiAgICAgICAgICAweDIwICAgIC8qIERhdGEgc2V0IHJlYWR5ICAgICAgICAgICAgICAgKi8KKyMgICAgICAgZGVmaW5lICBETV9DVFMgICAgICAgICAgMHgxMCAgICAvKiBDbGVhciB0byBzZW5kICAgICAgICAgICAgICAgICovCisjICAgICAgIGRlZmluZSAgRE1fUkkgICAgICAgICAgIDB4NDAgICAgLyogUmluZyBpbmRpY2F0b3IgICAgICAgICAgICAgICAqLworIyAgICAgICBkZWZpbmUgIERNX0RUUiAgICAgICAgICAweDAxICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICAgICAgICAgKi8KKworLyoKKyAqIGRlZmluZXMgZnJvbSBkZ2FwX2NvbmYuaAorICovCisjZGVmaW5lIE5VTExOT0RFIDAJCS8qIGhlYWRlciBub2RlLCBub3QgdXNlZCAqLworI2RlZmluZSBCTk9ERSAxCQkJLyogQm9hcmQgbm9kZSAqLworI2RlZmluZSBMTk9ERSAyCQkJLyogTGluZSBub2RlICovCisjZGVmaW5lIENOT0RFIDMJCQkvKiBDb25jZW50cmF0b3Igbm9kZSAqLworI2RlZmluZSBNTk9ERSA0CQkJLyogRUJJIE1vZHVsZSBub2RlICovCisjZGVmaW5lIFROT0RFIDUJCQkvKiB0dHkgbmFtZSBwcmVmaXggbm9kZSAqLworI2RlZmluZQlDVU5PREUgNgkJLyogY3UgbmFtZSBwcmVmaXggKG5vbi1TQ08pICovCisjZGVmaW5lIFBOT0RFIDcJCQkvKiB0cmFucy4gcHJpbnQgcHJlZml4IG5vZGUgKi8KKyNkZW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qLworI2RlZmluZSBEX0RTUihjaCkgICAgICAgY2gtPmNoX2RzciAgICAgIC8qIERhdGEgc2V0IHJlYWR5ICAgICAgICovCisjZGVmaW5lIERfUlRTKGNoKSAgICAgICBETV9SVFMgICAgICAgICAgLyogUmVxdWVzdCB0byBzZW5kICAgICAgKi8KKyNkZWZpbmUgRF9DVFMoY2gpICAgICAgIERNX0NUUyAgICAgICAgICAvKiBDbGVhciB0byBzZW5kICAgICAgICAqLworI2RlZmluZSBEX1JJKGNoKSAgICAgICAgRE1fUkkgICAgICAgICAgIC8qIFJpbmcgaW5kaWNhdG9yICAgICAgICovCisjZGVmaW5lIERfRFRSKGNoKSAgICAgICBETV9EVFIgICAgICAgICAgLyogRGF0YSB0ZXJtaW5hbCByZWFkeSAgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIFN0cnVjdHVyZXMgYW5kIGNsb3NlbHkgcmVsYXRlZCBkZWZpbmVzLgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qCisgKiBBIHN0cnVjdHVyZSB0byBob2xkIGEgc3RhdGlzdGljcyBjb3VudGVyLiAgV2UgYWxzbworICogY29tcHV0ZSBtb3ZpbmcgYXZlcmFnZXMgZm9yIHRoaXMgY291bnRlci4KKyAqLworc3RydWN0IG1hY291bnRlciB7CisJdTMyCQljbnQ7CS8qIFRvdGFsIGNvdW50ICovCisJdWxvbmcJCWFjY3VtOwkvKiBBY3V1bXVsYXRvciBwZXIgcGVyaW9kICovCisJdWxvbmcJCXNtYTsJLyogU2ltcGxlIG1vdmluZyBhdmVyYWdlICovCisJdWxvbmcJCWVtYTsJLyogRXhwb25lbnRpYWwgbW92aW5nIGF2ZXJhZ2UgKi8KK307CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqK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ioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCB1bl90IHsKKwlpbnQJbWFnaWM7CQkvKiBVbml0IE1hZ2ljIE51bWJlci4JCQkqLworCXN0cnVjdAljaGFubmVsX3QgKnVuX2NoOworCXUzMgl1bl90aW1lOworCXUzMgl1bl90eXBlOworCXUzMgl1bl9vcGVuX2NvdW50OwkvKiBDb3VudGVyIG9mIG9wZW5zIHRvIHBvcnQJCSovCisJc3RydWN0IHR0eV9zdHJ1Y3QgKnVuX3R0eTsvKiBQb2ludGVyIHRvIHVuaXQgdHR5IHN0cnVjdHVyZQkqLworCXUzMgl1bl9mbGFnczsJLyogVW5pdCBmbGFncwkJCQkqLworCXdhaXRfcXVldWVfaGVhZF90IHVuX2ZsYWdzX3dhaXQ7IC8qIFBsYWNlIHRvIHNsZWVwIHRvIHdhaXQgb24gdW5pdCAqLworCXUzMgl1bl9kZXY7CQkvKiBNaW5vciBkZXZpY2UgbnVtYmVyCQkJKi8KKwl0Y2ZsYWdfdCB1bl9vZmxhZzsJLyogb2ZsYWdzIGJlaW5nIGRvbmUgb24gYm9hcmQJCSovCisJdGNmbGFnX3QgdW5fbGZsYWc7CS8qIGxmbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLworCXN0cnVjdCBkZXZpY2UgKnVuX3N5c2ZzOworfTsKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBEZXZpY2UgZmxhZyBkZWZpbml0aW9ucyBmb3IgY2hfZmxhZ3MuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZSBDSF9QUk9OICAgICAgICAgMHgwMDAxICAgICAgICAgIC8qIFByaW50ZXIgb24gc3RyaW5nICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX09VVCAgICAgICAgICAweDAwMDIgICAgICAgICAgLyogRGlhbC1vdXQgZGV2aWNlIG9wZW4gICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfU1RPUCAgICAgICAgIDB4MDAwNCAgICAgICAgICAvKiBPdXRwdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAqLworI2RlZmluZSBDSF9TVE9QSSAgICAgICAgMHgwMDA4ICAgICAgICAgIC8qIElucHV0IGlzIHN0b3BwZWQgICAgICAgICAgICAgICAgICovCisjZGVmaW5lIENIX0NEICAgICAgICAgICAweDAwMTAgICAgICAgICAgLyogQ2FycmllciBpcyBwcmVzZW50ICAgICAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfRkNBUiAgICAgICAgIDB4MDAyMCAgICAgICAgICAvKiBDYXJyaWVyIGZvcmNlZCBvbiAgICAgICAgICAgICAgICAqLworCisjZGVmaW5lIENIX1JYQkxPQ0sgICAgICAweDAwODAgICAgICAgICAgLyogRW5hYmxlIHJ4IGJsb2NrZWQgZmxhZyAgICAgICAgICAgKi8KKyNkZWZpbmUgQ0hfV0xPVyAgICAgICAgIDB4MDEwMCAgICAgICAgICAvKiBUZXJtIHdhaXRpbmcgbG93IGV2ZW50ICAgICAgICAgICAqLworI2RlZmluZSBDSF9XRU1QVFkgICAgICAgMHgwMjAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBlbXB0eSBldmVudCAgICAgICAgICovCisjZGVmaW5lIENIX1JFTkFCTEUgICAgICAweDA0MDAgICAgICAgICAgLyogQnVmZmVyIGp1c3QgZW1wdGllZCAgICAgICAgICAqLworI2RlZmluZSBDSF9SQUNUSVZFICAgICAgMHgwODAwICAgICAgICAgIC8qIFByb2Nlc3MgYWN0aXZlIGluIHh4cmVhZCgpICAgKi8KKyNkZWZpbmUgQ0hfUldBSVQgICAgICAgIDB4MTAwMCAgICAgICAgICAvKiBQcm9jZXNzIHdhaXRpbmcgaW4geHhyZWFkKCkgICovCisjZGVmaW5lIENIX0JBVUQwCTB4MjAwMAkJLyogVXNlZCBmb3IgY2hlY2tpbmcgQjAgdHJhbnNpdGlvbnMgKi8KKyNkZWZpbmUgQ0hfSEFOR1VQICAgICAgIDB4ODAwMAkJLyogSGFuZ3VwIHJlY2VpdmVkICAgICAgICAgICAgICAgICAgKi8KKworLyoKKyAqIERlZmluaXRpb25zIGZvciBjaF9zbmlmZl9mbGFncworICovCisjZGVmaW5lIFNOSUZGX09QRU4JMHgxCisjZGVmaW5lIFNOSUZGX1dBSVRfREFUQQkweDIKKyNkZWZpbmUgU05JRkZfV0FJVF9TUEFDRSAweDQKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKioqCURlZmluaXRpb25zIGZvciBEaWdpIGRpdHR5KDEpIGNvbW1hbmQuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUaGlzIG1vZHVsZSBwcm92aWRlcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc3BlY2lhbCBEaWdpCisgKiBzZXJpYWwgbGluZSBlbmhhbmNlbWVudHMgd2hpY2ggYXJlIG5vdCBzdGFuZGFyZCBVTklYKHRtKSBmZWF0dXJlcy4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNpZiAhZGVmaW5lZChUSU9DTU9ERykKKworI2RlZmluZQlUSU9DTU9ERwkoKCdkJzw8OCkgfCAyNTApCQkvKiBnZXQgbW9kZW0gY3RybCBzdGF0ZQkqLworI2RlZmluZQlUSU9DTU9EUwkoKCdkJzw8OCkgfCAyNTEpCQkvKiBzZXQgbW9kZW0gY3RybCBzdGF0ZQkqLworCisjaWZuZGV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CQkweDAwMjAJCS8qIERDRCBvdXRwdXQgZmxvdyBjb250cm9sCSovCisjZGVmaW5lIERUUlBBQ0UJCTB4MDA0MAkJLyogRFRSIGlucHV0IGZsb3cgY29udHJvbAkqLworI2RlZmluZSBESUdJX0NPT0sJMHgwMDgwCQkvKiBDb29rZWQgcHJvY2Vzc2luZyBkb25lIGluIEZFUCAqLworI2RlZmluZSBESUdJX0ZPUkNFRENECTB4MDEwMAkJLyogRm9yY2UgY2FycmllcgkJKi8KKyNkZWZpbmUJRElHSV9BTFRQSU4JMHgwMjAwCQkvKiBBbHRlcm5hdGUgUkotNDUgcGluIGNvbmZpZwkqLworI2RlZmluZQlESUdJX0FJWE9OCTB4MDQwMAkJLyogQXV4IGZsb3cgY29udHJvbCBpbiBmZXAJKi8KKyNkZWZpbmUJRElHSV9QUklOVEVSCTB4MDgwMAkJLyogSG9sZCBwb3J0IG9wZW4gZm9yIGZsb3cgY250cmwqLworI2RlZmluZSBESUdJX1BQX0lOUFVUCTB4MTAwMAkJLyogQ2hhbmdlIHBhcmFsbGVsIHBvcnQgdG8gaW5wdXQqLworI2RlZmluZSBESUdJX0RUUl9UT0dHTEUgMHgyMDAwCQkvKiBTdXBwb3J0IERUUiBUb2dnbGUJCSovCisjZGVmaW5lCURJR0lfNDIyCTB4NDAwMAkJLyogZm9yIDQyMi8yMzIgc2VsZWN0YWJsZSBwYW5lbCAqLworI2RlZmluZSBESUdJX1JUU19UT0dHTEUJMHg4MDAwCQkvKiBTdXBwb3J0IFJUUyBUb2dnbGUJCSovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFRoZXNlIG9wdGlvbnMgYXJlIG5vdCBzdXBwb3J0ZWQgb24gdGhlIGNvbXhpLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNkZWZpbmUJRElHSV9DT01YSQkoRElHSV9GQVNUfERJR0lfQ09PS3xEU1JQQUNFfERDRFBBQ0V8RFRSUEFDRSkKKworI2RlZmluZSBESUdJX1BMRU4JMjgJCS8qIFN0cmluZyBsZW5ndGgJCSovCisjZGVmaW5lCURJR0lfVFNJWgkxMAkJLyogVGVybWluYWwgc3RyaW5nIGxlbgkJKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogU3RydWN0dXJlIHVzZWQgd2l0aCBpb2N0bCBjb21tYW5kcyBmb3IgRElHSSBwYXJhbWV0ZXJzLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBkaWdpX3QgeworCXVuc2lnbmVkIHNob3J0CWRpZ2lfZmxhZ3M7CQkvKiBGbGFncyAoc2VlIGFib3ZlKQkqLworCXVuc2lnbmVkIHNob3J0CWRpZ2lfbWF4Y3BzOwkJLyogTWF4IHByaW50ZXIgQ1BTCSovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9tYXhjaGFyOwkJLyogTWF4IGNoYXJzIGluIHByaW50IHF1ZXVlICovCisJdW5zaWduZWQgc2hvcnQJZGlnaV9idWZzaXplOwkJLyogQnVmZmVyIHNpemUJCSovCisJdW5zaWduZWQgY2hhcglkaWdpX29ubGVuOwkJLyogTGVuZ3RoIG9mIE9OIHN0cmluZwkqLworCXVuc2lnbmVkIGNoYXIJZGlnaV9vZmZsZW47CQkvKiBMZW5ndGggb2YgT0ZGIHN0cmluZwkqLworCWNoYXIJCWRpZ2lfb25zdHJbRElHSV9QTEVOXTsJLyogUHJpbnRlciBvbiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX29mZnN0cltESUdJX1BMRU5dOwkvKiBQcmludGVyIG9mZiBzdHJpbmcJKi8KKwljaGFyCQlkaWdpX3Rlcm1bRElHSV9UU0laXTsJLyogdGVybWluYWwgc3RyaW5nCSovCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBLTUUgZGVmaW5pdGlvbnMgYW5kIHN0cnVjdHVyZXMuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2RlZmluZQlSV19JRExFCQkwCS8qIE9wZXJhdGlvbiBjb21wbGV0ZQkJCSovCisjZGVmaW5lCVJXX1JFQUQJCTEJLyogUmVhZCBDb25jZW50cmF0b3IgTWVtb3J5CQkqLworI2RlZmluZQlSV19XUklURQkyCS8qIFdyaXRlIENvbmNlbnRyYXRvciBNZW1vcnkJCSovCisKK3N0cnVjdCByd190IHsKKwl1bnNpZ25lZCBjaGFyCXJ3X3JlcTsJCS8qIFJlcXVlc3QgdHlwZQkJCSovCisJdW5zaWduZWQgY2hhcglyd19ib2FyZDsJLyogSG9zdCBBZGFwdGVyIGJvYXJkIG51bWJlcgkqLworCXVuc2lnbmVkIGNoYXIJcndfY29uYzsJLyogQ29uY2VudHJhdG9yIG51bWJlcgkJKi8KKwl1bnNpZ25lZCBjaGFyCXJ3X3Jlc2VydmVkOwkvKiBSZXNlcnZlZCBmb3IgZXhwYW5zaW9uCSovCisJdW5zaWduZWQgbG9uZwlyd19hZGRyOwkvKiBBZGRyZXNzIGluIGNvbmNlbnRyYXRvcgkqLworCXVuc2lnbmVkIHNob3J0CXJ3X3NpemU7CS8qIFJlYWQvd3JpdGUgcmVxdWVzdCBsZW5ndGgJKi8KKwl1bnNpZ25lZCBjaGFyCXJ3X2RhdGFbMTI4XTsJLyogRGF0YSB0byByZWFkL3dyaXRlCQkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTaHJpbms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mX3Jlc2VydmI7CS8qIFJlc2VydmVkICovCisJdW5zaWduZWQgbG9uZwlzaHJpbmtfYnVmX3Jlc2VydmM7CS8qIFJlc2VydmVkICovCisJdW5zaWduZWQgbG9uZwlzaHJpbmtfYnVmX3Jlc2VydmQ7CS8qIFJlc2VydmVkICovCisKKwl1bnNpZ25lZCBjaGFyCXNocmlua19idWZfcmVzdWx0OwkvKiBSZWFzb24gZm9yIGNhbGwgZmFpbGluZworCQkJCQkJICAgWmVybyBpcyBHb29kIHJldHVybiAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9pbml0OwkvKiBOb24tWmVybyBpZiBpdCBjYXVzZWQgYW4KKwkJCQkJCSAgIHh4aW5pdCBjYWxsLiAqLworCisJdW5zaWduZWQgY2hhcglzaHJpbmtfYnVmX2FucG9ydHM7CS8qIE51bWJlciBvZiBhc3luYyBwb3J0cyAgKi8KKwl1bnNpZ25lZCBjaGFyCXNocmlua19idWZfc25wb3J0czsgCS8qIE51bWJlciBvZiBzeW5jICBwb3J0cyAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl90eXBlOwkvKiBCb2FyZCB0eXBlIDEgPSBQQy9YaSwKKwkJCQkJCQkgICAgICAyID0gUEMvWG0sCisJCQkJCQkJICAgICAgMyA9IFBDL1hlCisJCQkJCQkJICAgICAgNCA9IE1DL1hpCisJCQkJCQkJICAgICAgNSA9IENPTVgvaSAqLworCXVuc2lnbmVkIGNoYXIJc2hyaW5rX2J1Zl9jYXJkOwkvKiBDYXJkIG51bWJlciAqLworCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdG8gZ2V0IGRyaXZlciBzdGF0dXMgaW5mb3JtYXRpb24KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9kaW5mbyB7CisJdW5zaWduZWQgbG9uZwlkaW5mb19uYm9hcmRzOwkJLyogIyBib2FyZHMgY29uZmlndXJlZAkqLworCWNoYXIJCWRpbmZvX3Jlc2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KKwljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KK307CisKKyNkZWZpbmUJRElHSV9HRVRERAkoKCdkJzw8OCkgfCAyNDgpCQkvKiBnZXQgZHJpdmVyIGluZm8gICAgICAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItYm9hcmQgaW5mb3JtYXRpb24KKyAqCisgKiBwaHlzc2l6ZSBhbmQgbWVtc2l6ZSBkaWZmZXIgd2hlbiBib2FyZCBoYXMgIndpbmRvd2VkIiBtZW1vcnkKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9pbmZvIHsKKwl1bnNpZ25lZCBsb25nCWluZm9fYmRudW07CQkvKiBCb2FyZCBudW1iZXIgKDAgYmFzZWQpICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19pb3BvcnQ7CQkvKiBpbyBwb3J0IGFkZHJlc3MgICAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19waHlzYWRkcjsJCS8qIG1lbW9yeSBhZGRyZXNzICAgICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3BoeXNzaXplOwkJLyogU2l6ZSBvZiBob3N0IG1lbSB3aW5kb3cgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fbWVtc2l6ZTsJCS8qI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fZGF0YSBmb3IgY2hhbm5lbCAgICAgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19oZmxvdzsJCS8qIGhmbG93IGZvciBjaGFubmVsICAgICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3Jlc2VydmVkWzhdOwkvKiBmb3IgZnV0dXJlIGV4cGFuc2lvbiAgICAqLworfTsKKworI2RlZmluZQlESUdJX0dFVFNUQVQJKCgnZCc8PDgpIHwgMjQ0KQkJLyogZ2V0IGJvYXJkIGluZm8gICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKiBTdHJ1Y3R1cmUgdXNlZCB3aXRoIGlvY3RsIGNvbW1hbmRzIGZvciBwZXItY2hhbm5lbCBpbmZvcm1hdGlvbgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZGlnaV9jaCB7CisJdW5zaWduZWQgbG9uZwlpbmZvX2JkbnVtOwkJLyogQm9hcmQgbnVtYmVyICgwIGJhc2VkKSAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fY2hhbm5lbDsJCS8qIENoYW5uZWwgaW5kZXggbnVtYmVyICAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX2NoX2NmbGFnOwkJLyogQ2hhbm5lbCBjZmxhZyAgIAkgICAqLworCXVuc2lnbmVkIGxvbmcJaW5mb19jaF9pZmxhZzsJCS8qIENoYW5uZWwgaWZsYWcgICAJICAgKi8KKwl1bnNpZ25lZCBsb25nCWluZm9fY2hfb2ZsYWc7CQkvKiBDaGFubmVsIG9mbGFnICAgCSAgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX2Noc2l6ZTsJCS8qIENoYW5uZWwgc3RydWN0dXJlIHNpemUgICovCisJdW5zaWduZWQgbG9uZwlpbmZvX3NsZW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VAJMHg1CisjZGVmaW5lCUJEX0ZBSUxFRAkweDYKKyNkZWZpbmUgQkRfQUxMT0NBVEVECTB4NworI2RlZmluZSBCRF9UUklCT09UCTB4OAorI2RlZmluZQlCRF9CQURLTUUJMHg4MAorCisjZGVmaW5lIERJR0lfTE9PUEJBQ0sJICAgICAgKCgnZCc8PDgpIHwgMjUyKQkJLyogRW5hYmxlL2Rpc2FibGUgVUFSVCBpbnRlcm5hbCBsb29wYmFjayAqLworI2RlZmluZSBESUdJX1NQT0xMICAgICAgICAgICAgKCgnZCc8PDgpIHwgMjU0KQkJLyogY2hhbmdlIHBvbGxlciByYXRlICAgKi8KKworI2RlZmluZSBESUdJX1NFVENVU1RPTUJBVUQJX0lPVygnZScsIDEwNiwgaW50KQkvKiBTZXQgaW50ZWdlciBiYXVkIHJhdGUgKi8KKyNkZWZpbmUgRElHSV9HRVRDVVNUT01CQVVECV9JT1IoJ2UnLCAxMDcsIGludCkJLyogR2V0IGludGVnZXIgYmF1ZCByYXRlICovCisjZGVmaW5lIERJR0lfUkVTRVRfUE9SVAkJKCgnZSc8PDgpIHwgOTMpCQkvKiBSZXNldCBwb3J0CQkqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBDaGFubmVsIGluZm9ybWF0aW9uIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgY2hhbm5lbF90IHsKKwlpbnQgbWFnaWM7CQkJLyogQ2hhbm5lbCBNYWdpYyBOdW1iZXIJCSovCisJc3RydWN0IGJzX3QJKmNoX2JzOwkJLyogQmFzZSBzdHJ1Y3R1cmUgcG9pbnRlciAgICAgICAqLworCXN0cnVjdCBjbV90CSpjaF9jbTsJCS8qIENvbW1hbmQgcXVldWUgcG9pbnRlciAgICAgICAgKi8KKw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hZ3M7CQkvKiBDaGFubmVsIGZsYWdzICAgICAgICAgICAgICAgICovCisJd2FpdF9xdWV1ZV9oZWFkX3QgY2hfc25pZmZfd2FpdDsKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIENvbW1hbmQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGNtX3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRXZlbnQgc3RydWN0dXJlIGRlZmluaXRpb24uCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RydWN0IGV2X3QgeworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X2hlYWQ7CS8qIENvbW1hbmQgYnVmZmVyIGhlYWQgb2Zmc2V0CSovCisJdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfdGFpbDsJLyogQ29tbWFuZCBidWZmZXIgdGFpbCBvZmZzZXQJKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl9zdGFydDsJLyogc3RhcnQgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X21heDsJCS8qIGxhc3Qgb2Zmc2V0IG9mIGJ1ZmZlcgkqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogRG93bmxvYWQgYnVmZmVyIHN0cnVjdHVyZS4KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdHJ1Y3QgZG93bmxkX3QgeworCXVjaGFyCWRsX3R5cGU7CQkvKiBIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICovCisJdWNoYXIJZGxfc2VxOwkJCS8qIERvd25sb2FkIHNlcXVlbmNlICAgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc3JldjsJCS8qIFNvZnR3YXJlIHJldmlzaW9uIG51bWJlciAgICAgKi8KKwl1c2hvcnQJZGxfbHJldjsJCS8qIExvdyByZXZpc2lvbiBudW1iZXIgICAgICAgICAgKi8KKwl1c2hvcnQJZGxfaHJldjsJCS8qIEhpZ2ggcmV2aXNpb24gbnVtYmVyICAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2VnOwkJCS8qIFN0YXJ0IHNlZ21lbnQgYWRkcmVzcyAgICAgICAgKi8KKwl1c2hvcnQJZGxfc2l6ZTsJCS8qIE51bWJlciBvZiBieXRlcyB0byBkb3dubG9hZCAgKi8KKwl1Y2hhcglkbF9kYXRhWzEwMjRdOwkJLyogRG93bmxvYWQgZGF0YSAgICAgICAgICAgICAgICAqLworfTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFcgPSByZWFkIHdyaXRlICAgICAgICBSID0gcmVhZCBvbmx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIEMgPSBjaGFuZ2VkIGJ5IGNvbW1hbmRzIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogICAgICAgIFUgPSB1bmtub3duIChtYXkgYmUgY2hhbmdlZCB3L28gbm90aWNlKSAgICAgICAgICAgICAgICAgICAgICAgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0cnVjdCBic190IHsKKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgdHBfam1wOwkvKiBUcmFuc21pdCBwb2xsIGp1bXAJCSAqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0Y19qbXA7CS8qIENvb2tlZCBwcm9jZWR1cmUganVtcAkgKi8KKwl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCAgcmlfam1wOwkvKiBOb3QgY3VycmVudGx5IHVzZWQJCSAqLworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICBycF9qbXA7CS8qIFJlY2VpdmUgcG9sbCBqdW1wCQkgKi8KKworCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0ICB0eF9zZWc7CS8qIFcgIFR4IHNlZ21lbnQJICovCisJdm9sYXRpbGUgdW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ioqKioqKioqKioqKioqKioqKioKLSoKLSogRnVuY3Rpb246Ci0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0qICAgIGRnYXBfcG9sbF9oYW5kbGVyCi0qCi0qIEF1dGhvcjoKLSoKLSogICAgU2NvdHQgSCBLaWxhdQotKiAgICAgICAKLSogUGFyYW1ldGVyczoKLSoKLSogICAgZHVtbXkgLS0gaWdub3JlZCAgICAgICAgICAgICAgICAgICAgCi0qCi0qIFJldHVybiBWYWx1ZXM6Ci0qCi0qICAgIG5vbmUKLSoKLSogRGVzY3JpcHRpb246ICAgCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0qICAgIEFzIGVhY2ggdGltZXIgZXhwaXJlcywgaXQgZGV0ZXJtaW5lcyAoYSkgd2hldGhlciB0aGUgInRyYW5zbWl0IgotKiAgICB3YWl0ZXIgbmVlZHMgdG8gYmUgd29rZW4gdXAsIGFuZCAoYikgd2hldGhlciB0aGUgcG9sbGVyIG5lZWRzIHRvCi0qICAgIGJlIHJlc2NoZWR1bGVkLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBkZ2FwX3BvbGxfaGFuZGxlcih1bG9uZyBkdW1teSkKLXsKLQlpbnQgaTsKLSAgICAgICAgc3RydWN0IGJvYXJkX3QgKmJyZDsKLSAgICAgICAgdW5zaWduZWQgbG9uZyBsb2NrX2ZsYWdzOwotICAgICAgICB1bnNpZ25lZCBsb25nIGxvY2tfZmxhZ3MyOwotCXVsb25nIG5ld190aW1lOwotCi0JZGdhcF9wb2xsX2NvdW50ZXIrKzsKLQotCi0JLyoKLQkgKiBJZiBkcml2ZXIgbmVlZHMgdGhlIGNvbmZpZyBmaWxlIHN0aWxsLAotCSAqIGtlZXAgdHJ5aW5nIHRvIHdha2UgdXAgdGhlIGRvd25sb2FkZX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GludXgvdHlwZXMuaD4gICAgICAgIC8qIFRvIHBpY2sgdXAgdGhlIHZhcmlvbnMgTGludXggdHlwZXMgKi8KLSNpbmNsdWRlIDxsaW51eC90dHkuaD4gICAgICAgICAgLyogVG8gcGljayB1cCB0aGUgdmFyaW91cyB0dHkgc3RydWN0cy9kZWZpbmVzICovCi0jaW5jbHVkZSA8bGludXgvaW50ZXJydXB0Lmg+ICAgIC8qIEZvciBpcnFyZXR1cm5fdCB0eXBlICovCi0KLSNpbmNsdWRlICJkZ2FwX3R5cGVzLmgiICAgICAgICAgLyogQWRkaXRpb25hbCB0eXBlcyBuZWVkZWQgYnkgdGhlIERpZ2kgaGVhZGVyIGZpbGVzICovCi0jaW5jbHVkZSAiZGlnaS5oIiAgICAgICAgICAgICAgIC8qIERpZ2kgc3BlY2lmaWMgaW9jdGwgaGVhZGVyICovCi0jaW5jbHVkZSAiZGdhcF9rY29tcGF0LmgiICAgICAgIC8qIEtlcm5lbCAyLjQvMi42IGNvbXBhdCBpbmNsdWRlcyAqLwotI2luY2x1ZGUgImRnYXBfc3lzZnMuaCIJCS8qIFN1cHBvcnQgZm9yIFNZU0ZTICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogRHJpdmVyIGRlZmluZXMKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoKLSAqIERyaXZlciBpZGVudGlmaWNhdGlvbiwgZXJyb3IgYW5kIGRlYnVnZ2luZyBzdGF0bWVudHMKLSAqCi0gKiBJbiB0aGVvcnksIHlvdSBjYW4gY2hhbmdlIGFsbCBvY2N1cnJlbmNlcyBvZiAiZGlnaSIgaW4gdGhlIG5leHQKLSAqIHRocmVlIGxpbmVzLCBhbmQgdGhlIGRyaXZlciBwcmludGsncyB3aWxsIGFsbCBhd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gYSByZXF1ZXN0ZWQgY29uY2VudHJhdG9yIGltYWdlIGNhbiBiZSBpbi4KLSAqLwotZW51bSB7Ci0JTk9fUEVORElOR19DT05DRU5UUkFUT1JfUkVRVUVTVFMgPSAwLAotCU5FRURfQ09OQ0VOVFJBVE9SLAotCVJFUVVFU1RFRF9DT05DRU5UUkFUT1IKLX07Ci0KLWV4dGVybiBjaGFyICpkZ2FwX3N0YXRlX3RleHRbXTsKLWV4dGVybiBjaGFyICpkZ2FwX2RyaXZlcl9zdGF0ZV90ZXh0W107Ci0KLQotLyogCi0gKiBNb2RlbSBsaW5lIGNvbnN0YW50cyBhcmUgZGVmaW5lZCBhcyBtYWNyb3MgYmVjYXVzZSBEU1IgYW5kCi0gKiBEQ0QgYXJlIHN3YXBhYmxlIHVzaW5nIHRoZSBkaXR0eSBhbHRwaW4gb3B0aW9uLgotICovCi0jZGVmaW5lIERfQ0QoY2gpICAgICAgICBjaC0+Y2hfY2QgICAgICAgLyogQ2FycmllciBkZXRlY3QgICAgICAgKi8KLSNkZWZpbmUgRF9EU1IoY2gpICAgICAgIGNoLT5jaF9kc3IgICAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAqLwotI2RlZmluZSBEX1JUUyhjaCkgICAgICAgRE1fUlRTICAgICAgICAgIC8qIFJlcXVlc3QgdG8gc2VuZCAgICAgICovCi0jZGVmaW5lIERfQ1RTKGNoKSAgICAgICBETV9DVFMgICAgICAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgKi8KLSNkZWZpbmUgRF9SSShjaCkgICAgICAgIERNX1JJICAgICAgICAgICAvKiBSaW5nIGluZGljYXRvciAgICAgICAqLwotI2RlZmluZSBEX0RUUihjaCkgICAgICAgRE1fRFRSICAgICAgICAgIC8qIERhdGEgdGVybWluYWwgcmVhZHkgICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiB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Hk7LyogUG9pbnRlciB0byB1bml0IHR0eSBzdHJ1Y3R1cmUJKi8KLQl1MzIJdW5fZmxhZ3M7CS8qIFVuaXQgZmxhZ3MJCQkJKi8KLQl3YWl0X3F1ZXVlX2hlYWRfdCB1bl9mbGFnc193YWl0OyAvKiBQbGFjZSB0byBzbGVlcCB0byB3YWl0IG9uIHVuaXQgKi8KLQl1MzIJdW5fZGV2OwkJLyogTWlub3IgZGV2aWNlIG51bWJlcgkJCSovCi0JdGNmbGFnX3QgdW5fb2ZsYWc7CS8qIG9mbGFncyBiZWluZyBkb25lIG9uIGJvYXJkCQkqLwotCXRjZmxhZ190IHVuX2xmbGFnOwkvKiBsZmxhZ3MgYmVpbmcgZG9uZSBvbiBib2FyZAkJKi8KLQlzdHJ1Y3QgZGV2aWNlICp1bl9zeXNmczsKLX07Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAqIERldmljZSBmbGFnIGRlZmluaXRpb25zIGZvciBjaF9mbGFncy4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIENIX1BST04gICAgICAgICAweDAwMDEgICAgICAgICAgLyogUHJpbnRlciBvbiBzdHJpbmcgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfT1VUICAgICAgICAgIDB4MDAwMiAgICAgICAgICAvKiBEaWFsLW91dCBkZXZpY2Ugb3BlbiAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9TVE9QICAgICAgICAgMHgwMDA0ICAgICAgICAgIC8qIE91dHB1dCBpcyBzdG9wcGVkICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIENIX1NUT1BJICAgICAgICAweDAwMDggICAgICAgICAgLyogSW5wdXQgaXMgc3RvcHBlZCAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfQ0QgICAgICAgICAgIDB4MDAxMCAgICAgICAgICAvKiBDYXJyaWVyIGlzIHByZXNlbnQgICAgICAgICAgICAgICAqLwotI2RlZmluZSBDSF9GQ0FSICAgICAgICAgMHgwMDIwICAgICAgICAgIC8qIENhcnJpZXIgZm9yY2VkIG9uICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgQ0hfUlhCTE9DSyAgICAgIDB4MDA4MCAgICAgICAgICAvKiBFbmFibGUgcnggYmxvY2tlZCBmbGFnICAgICAgICAgICAqLwotI2RlZmluZSBDSF9XTE9XICAgICAgICAgMHgwMTAwICAgICAgICAgIC8qIFRlcm0gd2FpdGluZyBsb3cgZXZlbnQgICAgICAgICAgICovCi0jZGVmaW5lIENIX1dFTVBUWSAgICAgICAweDAyMDAgICAgICAgICAgLyogVGVybSB3YWl0aW5nIGVtcHR5IGV2ZW50ICAgICAgICAgKi8KLSNkZWZpbmUgQ0hfUkVOQUJMRSAgICAgIDB4MDQwMCAgICAgICAgICAvKiBCdWZmZXIganVzdCBlbXB0aWVkICAgICAgICAgICovCi0jZGVmaW5lIENIX1JBQ1RJVkUgICAgICAweDA4MDAgICAgICAgICAgLyogUHJvY2VzcyBhY3RpdmUgaW4geHhyZWFkKCkgICAqLwotI2RlZmluZSBDSF9SV0FJVCAgICAgICAgMHgxMDAwICAgICAgICAgIC8qIFByb2Nlc3Mgd2FpdGluZyBpbiB4eHJlYWQoKSAgKi8KLSNkZWZpbmUgQ0hfQkFVRDAJMHgyMDAwCQkvKiBVc2VkIGZvciBjaGVja2luZyBCMCB0cmFuc2l0aW9ucyAqLwotI2RlZmluZSBDSF9IQU5HVVAgICAgICAgMHg4MDAwCQkvKiBIYW5ndXAgcmVjZWl2ZWQgICAgICAgICAgICAgICAgICAqLwotCi0vKgotICogRGVmaW5pdGlvbnMgZm9yIGNoX3NuaWZmX2ZsYWdzCi0gKi8KLSNkZWZpbmUgU05JRkZfT1BFTgkweDEKLSNkZWZpbmUgU05JRkZfV0FJV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faGVhZCkpOwotCQl0YWlsID0gcmVhZHcoJihjbV9hZGRyLT5jbV90YWlsKSk7Ci0KLQkJbiA9IChoZWFkIC0gdGFpbCkgJiAoQ01ETUFYIC0gQ01EU1RBUlQgLSA0KTsKLQotCQlpZiAobiA8PSBuY21kcyAqIHNpemVvZihzdHJ1Y3QgY21fdCkpCi0JCQlicmVhazsKLQotCQlpZiAoLS1jb3VudCA9PSAwKSB7Ci0JCQlEUFJfQ09SRSgoIiVzOiVkIGZhaWxpbmcgYm9hcmQuXG4iLF9fRklMRV9fLCBfX0xJTkVfXykpOwotCQkJY2gtPmNoX2JkLT5zdGF0ZSA9IEJPQVJEX0ZBSUxFRDsKLQkJCXJldHVybjsKLQkJfQotCQl1ZGVsYXkoMTApOwotCX0KLX0KLQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKgotICogICAgICBkZ2FwX2NtZHcgLSBTZW5kcyBhIDEgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAotICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgotICoKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBkZ2FwX2NtZHcoc3RydWN0IGNo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WlmICgtLWNvdW50ID09IDApIHsKLQkJCURQUl9DT1JFKCgiJXM6JWQgRmFpbGluZyBib2FyZC5cbiIsX19GSUxFX18sIF9fTElORV9fKSk7Ci0JCQljaC0+Y2hfYmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOwotCQkJcmV0dXJuOwotCQl9Ci0JCXVkZWxheSgxMCk7Ci0JfQotfQotCi0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICoKLSAqICAgICAgZGdhcF9jbWR3X2V4dCAtIFNlbmRzIGEgZXh0ZW5kZWQgd29yZCBjb21tYW5kIHRvIHRoZSBGRVAuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGNtZCAgICAgLSBDb21tYW5kIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgd29yZCAgICAtIEludGVnZXIgY29udGFpbmluZyB3b3JkIHRvIGJlIHNlbnQuCi0gKiAgICAgICAgICAgICAgbmNtZHMgICAtIFdhaXQgdW50aWwgbmNtZHMgb3IgZmV3ZXIgY21kcyBhcmUgbGVmdAotICogICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgY21kIGJ1ZmZlciBiZWZvcmUgcmV0dXJuaW5nLgotICoKLSAqPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotc3RhdGljIHZvaWQgZGdhcF9jbWR3X2V4dChzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgdTE2IGNtZCwgdTE2IHdvcmQsIHVpbnQgbmNtZHMpCi17Ci0JY2hhcgkJKnZhZGRyID0gTlVMTDsKLQlzdHJ1Y3QgY21fdAkqY21fYWRkciA9IE5VTEw7Ci0JdWludAkJY291bnQ7Ci0JdWludAkJbjsKLQl1MTYJ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lzaCwgZGVjbGFyZSB0aGUgRkVQIGRlYWQuCi0JICovCi0JZm9yIChjb3VudCA9IGRnYXBfY291bnQgOzspIHsKLQotCQloZWFkID0gcmVhZHcoJihjbV9hZGRyLT5jbV9oZWFkKSk7Ci0JCXRhaWwgPSByZWFkdygmKGNtX2FkZHItPmNtX3RhaWwpKTsKLQotCQluID0gKGhlYWQgLSB0YWlsKSAmIChDTURNQVggLSBDTURTVEFSVCAtIDQpOwotCi0JCWlmIChuIDw9IG5jbWRzICogc2l6ZW9mKHN0cnVjdCBjbV90KSkKLQkJCWJyZWFrOwotCi0JCWlmICgtLWNvdW50ID09IDApIHsKLQkJCURQUl9DT1JFKCgiJXM6JWQgRmFpbGluZyBib2FyZC5cbiIsX19GSUxFX18sIF9fTElORV9fKSk7Ci0JCQljaC0+Y2hfYmQtPnN0YXRlID0gQk9BUkRfRkFJTEVEOwotCQkJcmV0dXJuOwotCQl9Ci0JCXVkZWxheSgxMCk7Ci0JfQotfQotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqCi0gKiAgICAgIGRnYXBfd21vdmUgLSBXcml0ZSBkYXRhIHRvIEZFUCBidWZmZXIuCi0gKgotICogICAgICAgICAgICAgIGNoICAgICAgLSBQb2ludGVyIHRvIGNoYW5uZWwgc3RydWN0dXJlLgotICogICAgICAgICAgICAgIGJ1ZiAgICAgLSBQb2l0ZXIgdG8gY2hhcmFjdGVycyB0byBiZSBtb3ZlZC4KLSAqICAgICAgICAgICAgICBjbnQgICAgIC0gTnVtYmVyIG9mIGNoYXJhY3RlcnMgdG8gbW92ZS4KLSAqCi0gKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLXZvaWQgZGdhcF93bW92ZShzdHJ1Y3QgY2hhbm5lbF90ICpjaCwgY2hhciAqYnVmLCB1aW50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RhdGlvbiwgSW5jLiwgNjc1IE1hc3MgQXZlLCBDYW1icmlkZ2UsIE1BIDAyMTM5LCBVU0EuCi0gKgotICoJTk9URTogVEhJUyBJUyBBIFNIQVJFRCBIRUFERVIuIERPIE5PVCBDSEFOR0UgQ09ESU5HIFNUWUxFISEhCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAqKioJRkVQIFZlcnNpb24gNSBkZXBlbmRlbnQgZGVmaW5pdGlvbnMKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19ER0FQX0ZFUDVfSAotI2RlZmluZSBfX0RHQVBfRkVQNV9ICi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgRkVQIG1lbW9yeSBvZmZzZXRzCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2RlZmluZSBTVEFSVCAgICAgICAgICAgMHgwMDA0TCAgICAgICAgIC8qIEV4ZWN1dGlvbiBzdGFydCBhZGRyZXNzICAgICAgKi8KLQotI2RlZmluZSBDTURCVUYgICAgICAgICAgMHgwZDEwTCAgICAgICAgIC8qIENvbW1hbmQgKGNtX3QpIHN0cnVjdHVyZSBvZmZzZXQgKi8KLSNkZWZpbmUgQ01EU1RBUlQgICAgICAgIDB4MDQwMEwgICAgICAgICAvKiBTdGFydCBvZiBjb21tYW5kIGJ1ZmZlciAgICAgICovICAgCi0jZGVmaW5lIENNRE1BWCAgICAgICAgICAweDA4MDBMICAgICAgICAgLyogRW5kIG9mIGNvbW1hbmQgYnVmZmVyICAgICAgICAqLwotCi0jZGVmaW5lIEVWQlVGICAgICA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ZmZXIgaGVhZCBvZmZzZXQJKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBjbV90YWlsOwkvKiBDb21tYW5kIGJ1ZmZlciB0YWlsIG9mZnNldAkqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGNtX3N0YXJ0OwkvKiBzdGFydCBvZmZzZXQgb2YgYnVmZmVyCSovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgY21fbWF4OwkJLyogbGFzdCBvZmZzZXQgb2YgYnVmZmVyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBFdmVudCBzdHJ1Y3R1cmUgZGVmaW5pdGlvbi4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgZXZfdCB7Ci0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfaGVhZDsJLyogQ29tbWFuZCBidWZmZXIgaGVhZCBvZmZzZXQJKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBzaG9ydCBldl90YWlsOwkvKiBDb21tYW5kIGJ1ZmZlciB0YWlsIG9mZnNldAkqLwotCXZvbGF0aWxlIHVuc2lnbmVkIHNob3J0IGV2X3N0YXJ0OwkvKiBzdGFydCBvZmZzZXQgb2YgYnVmZmVyCSovCi0Jdm9sYXRpbGUgdW5zaWduZWQgc2hvcnQgZXZfbWF4OwkJLyogbGFzdCBvZmZzZXQgb2YgYnVmZmVyCSovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBEb3dubG9hZCBidWZmZXIgc3RydWN0dXJlLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBkb3dubGRfdCB7Ci0JdWNoYXIJZGxfdHlwZTsJCS8qIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQl1Y2hhcglkbF9zZXE7CQkJLyogRG93bmxvYWQgc2VxdWVuY2UgICAgICAgICAgICAqLwotCXVzaG9ydAlkbF9zcmV2OwkJLyogU29mdHdhcmUgcmV2aXNpb24gbnVtYmVyICAgICAqLwotCXVzaG9ydAlkbF9scmV2OwkJLyogTG93IHJldmlzaW9uIG51bWJlciAgICAgICAgICAqLwotCXVzaG9ydAlkbF9ocmV2OwkJLyogSGlnaCByZXZpc2lvbiBudW1iZXIgICAgICAgICAqLwotCXVzaG9ydAlkbF9zZWc7CQkJLyogU3RhcnQgc2VnbWVudCBhZGRyZXNzICAgICAgICAqLwotCXVzaG9ydAlkbF9zaXplOwkJLyogTnVtYmVyIG9mIGJ5dGVzIHRvIGRvd25sb2FkICAqLwotCXVjaGFyCWRsX2RhdGFbMTAyNF07CQkvKiBEb3dubG9hZCBkYXRhICAgICAgICAgICAgICAgICovCi19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICogUGVyIGNoYW5uZWwgYnVmZmVyIHN0cnVjdHVyZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgIEJhc2UgU3RydWN0dXJlIEVudHJpZXMgVXNhZ2UgTWVhbmluZ3MgdG8gSG9zdCAgICAgICAgICAgKiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCi0gKiAgICAgICAgVyA9IHJlYWQgd3JpdGUgICAgICAgIFIgPSByZWFkIG9ubHkgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAotICog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ZmIGNoYXIgICAgICAqLwotCXZvbGF0aWxlIHVuc2lnbmVkIGNoYXIgICBzdGFydGM7CS8qIFcgICBYb24gY2hhcmFjdGVyICAgICAgICAgICAgICovCi0Jdm9sYXRpbGUgdW5zaWduZWQgY2hhciAgIHN0b3BjOwkJLyogVyAgIFhvZmYgY2hhcmFjdGVyICAgICAgICAgICAqLwotCXZvbGF0aWxlIHVuc2lnbmVkIGNoYXIgICB2bmV4dGM7CS8qIFcgICBWbmV4dCBjaGFyYWN0ZXIgICAgICAgICAgICovCi0Jdm9sYXRpbGUgdW5zaWduZWQgY2hhciAgIGhmbG93OwkJLyogQyAgIFNvZnR3YXJlIGZsb3cgY29udHJvbCAgICAqLwotCi0Jdm9sYXRpbGUgdW5zaWduZWQgY2hhciAgIGZpbGxjOwkJLyogVSAgIERlbGF5IEZpbGwgY2hhcmFjdGVyICAgICAqLwotCXZvbGF0aWxlIHVuc2lnbmVkIGNoYXIgICBvY2hhcjsJCS8qIFUgICBTYXZlZCBvdXRwdXQgY2hhcmFjdGVyICAgKi8KLQl2b2xhdGlsZSB1bnNpZ25lZCBjaGFyICAgb21hc2s7CQkvKiBVICAgT3V0cHV0IGNoYXJhY3RlciBtYXNrICAgICovCi0KLQl2b2xhdGlsZSB1bnNpZ25lZCBjaGFyICAgYmZpbGxbMTNdOwkvKiBVICAgUmVzZXJ2ZWQgZm9yIGV4cGFuc2lvbiAgICovICAKLQotCXZvbGF0aWxlIHVuc2lnbmVkIGNoYXIgICBzY2NbMTZdOwkvKiBVICAgU0NDIHJlZ2lzdGVycyAgICAgICAgICAgICovCi19OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogICAKLSAqIEZFUCBzdXBwb3J0ZWQgZnVuY3Rpb25zCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwot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nggYnVmZmVyIHNpemUgYXZhaWwqLwotI2RlZmluZSBTT0ZMQUcJCTB4ZjMJCS8qIFNldCBVTklYIG9mbGFncwkJKi8KLSNkZWZpbmUgU0hGTE9XCQkweGY0CQkvKiBTZXQgaGFyZHdhcmUgaGFuZHNoYWtlCSovCi0jZGVmaW5lIFNDRkxBRwkJMHhmNQkJLyogU2V0IFVOSVggY2ZsYWdzCQkqLwotI2RlZmluZSBTVk5FWFQJCTB4ZjYJCS8qIFNldCBWTkVYVCBjaGFyYWN0ZXIJCSovCi0jZGVmaW5lIFNQSU5URkMJCTB4ZmMJCS8qIFJlc2VydmVkCQkJKi8KLSNkZWZpbmUgU0NPTU1PREUJMHhmZAkJLyogU2V0IFJTMjMyLzQyMiBtb2RlCQkqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKglNb2RlcyBmb3IgU0NPTU1PREUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIE1PREVfMjMyCTB4MDAKLSNkZWZpbmUgTU9ERV80MjIJMHgwMQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gKiAgICAgIEV2ZW50IGZsYWdzLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNkZWZpbmUgSUZCUkVBSyAgICAgICAgIDB4MDEgICAgICAgICAgICAvKiBCcmVhayByZWNlaXZlZCAgICAgICAgICAgICAgICovICAKLSNkZWZpbmUgSUZUTFcgICAgICAgICAgIDB4MDIgICAgICAgICAgICAvKiBUcmFuc21pdCBsb3cgd2F0ZXIgICAgICAgICAgICovCi0jZGVmaW5lIElGVEVNICAgICAgICAgICAweDA0ICAgICAgICAgICAgLyogVHJhbnNtaXR0ZXIgZW1wdHkgICAgICAgICAgICAqLwotI2RlZmluZSBJRkRBVEEgICAgICAgICAgMHgwOCAgICAgICAgICAgIC8qIFJlY2VpdmUgZGF0YSBwcmVzZW50ICAgICAgICAgKi8KLSNkZWZpbmUgSUZNT0RFTSAgICAgICAgIDB4MjAgICAgICAgICAgICAvKiBNb2RlbSBzdGF0dXMgY2hhbmdlICAgICAgICAgICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogICAKLSAqICAgICAgTW9kZW0gZmxhZ3MKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jICAgICAgIGRlZmluZSAgRE1fUlRTICAgICAgICAgIDB4MDIgICAgLyogUmVxdWVzdCB0byBzZW5kICAgICAgICAgICAgICAqLwotIyAgICAgICBkZWZpbmUgIERNX0NEICAgICAgICAgICAweDgwICAgIC8qIENhcnJpZXIgZGV0ZWN0ICAgICAgICAgICAgICAgKi8KLSMgICAgICAgZGVmaW5lICBETV9EU1IgICAgICAgICAgMHgyMCAgICAvKiBEYXRhIHNldCByZWFkeSAgICAgICAgICAgICAgICovCi0jICAgICAgIGRlZmluZSAgRE1fQ1RTICAgICAgICAgIDB4MTAgICAgLyogQ2xlYXIgdG8gc2VuZCAgICAgICAgICAgICAgICAqLwotIyAgICAgICBkZWZpbmUgIERNX1JJICAgICAgICAgICAweDQwICAgIC8qIFJpbmcgaW5kaWNhdG9yICAgICAgICAgICAgICAgKi8KLSMgICAgICAgZGVmaW5lICBETV9EVFIgICAgICAgICAgMHgwMSAgICAvKiBEYXRhIHRlcm1pbmFsIHJlYWR5ICAgICAgICAgICovCi0KLQotI2VuZGlmCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZGdhcC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vciBtb3JlIGRldGFpbHMuCi0gKgotICogWW91IHNob3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKLSAqIGFsb25nIHdpdGggdGhpcyBwcm9ncmFtOyBpZiBub3QsIHdyaXRlIHRvIHRoZSBGcmVlIFNvZnR3YXJlCi0gKiBGb3VuZGF0aW9uLCBJbmMuLCA2NzUgTWFzcyBBdmUsIENhbWJyaWRnZSwgTUEgMDIxMzksIFVTQS4KLSAqCi0gKglOT1RFOiBUSElTIElTIEEgU0hBUkVEIEhFQURFUi4gRE8gTk9UIENIQU5HRSBDT0RJTkcgU1RZTEUhISEKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqIFRoaXMgZmlsZSBpcyBpbnRlbmRlZCB0byBjb250YWluIGFsbCB0aGUga2VybmVsICJkaWZmZXJlbmNlcyIgYmV0d2VlbiB0aGUKLSAqIHZhcmlvdXMga2VybmVscyB0aGF0IHdlIHN1cHBvcnQuCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19ER0FQX0tDT01QQVRfSAotI2RlZmluZSBfX0RHQVBfS0NPTVBBVF9ICi0KLSNpZiAhZGVmaW5lZChUVFlfRkxJUEJVRl9TSVpFKQotIyBkZWZpbmUgVFRZX0ZMSVBCVUZfU0laRSA1MTIKLSNlbmRpZgotCi0KLS8qIFNwYXJzZSBzdHVmZiAqLwotIyBpZm5kZWYgX191c2VyCi0jICBkZWZpbmUgX191c2VyCi0jICBkZWZpbmUgX19rZXJuZWwKLSMgIGRlZmluZSBfX3NhZmUKLSMgIGRlZmluZSBfX2ZvcmNlCi0jICBkZWZpbmUgX19jaGtfdXNlcl9wdHIoeCkgKHZvaWQpMA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MDkvMTAvMjMgMTQ6MDE6NTcgbWFya2ggRXhwICQKLSAqCi0gKglOT1RFOiBUSElTIElTIEEgU0hBUkVEIEhFQURFUi4gRE8gTk9UIENIQU5HRSBDT0RJTkcgU1RZTEUhISEKLSAqLwotCi0jaWZuZGVmIF9fRElHSV9ICi0jZGVmaW5lIF9fRElHSV9ICi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqKioJRGVmaW5pdGlvbnMgZm9yIERpZ2kgZGl0dHkoMSkgY29tbWFuZC4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoKLSAqIENvcHlyaWdodCAoYykgMTk4OC05NiBEaWdpIEludGVybmF0aW9uYWwgSW5jLiwgQWxsIFJpZ2h0cyBSZXNlcnZlZC4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBUaGlzIG1vZHVsZSBwcm92aWRlcyBhcHBsaWNhdGlvbiBhY2Nlc3MgdG8gc3BlY2lhbCBEaWdpCi0gKiBzZXJpYWwgbGluZSBlbmhhbmNlbWVudHMgd2hpY2ggYXJlIG5vdCBzdGFuZGFyZCBVTklYKHRtKSBmZWF0dXJlcy4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZiAhZGVmaW5lZChUSU9DTU9ERykKLQotI2RlZmluZQlUSU9DTU9ERwkoJ2QnPDw4KSB8IDI1MAkJLyogZ2V0IG1vZGVtIGN0cmwgc3RhdGUJKi8KLSNkZWZpbmUJVElPQ01PRFMJKCdkJzw8OCkgfCAyNTEJCS8qIHNldCBtb2RlbSBjdHJsIHN0YXRlCSovCi0KL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qKioqKioqCi0gKiBTdHJ1Y3R1cmUgdG8gZ2V0IGRyaXZlciBzdGF0dXMgaW5mb3JtYXRpb24KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgZGlnaV9kaW5mbyB7Ci0JdW5zaWduZWQgbG9uZwlkaW5mb19uYm9hcmRzOwkJLyogIyBib2FyZHMgY29uZmlndXJlZAkqLwotCWNoYXIJCWRpbmZvX3Jlc2VydmVkWzEyXTsJLyogZm9yIGZ1dHVyZSBleHBhbnNpb24gKi8KLQljaGFyCQlkaW5mb192ZXJzaW9uWzE2XTsJLyogZHJpdmVyIHZlcnNpb24gICAgICAgKi8KLX07Ci0KLSNkZWZpbmUJRElHSV9HRVRERAkoJ2QnPDw4KSB8IDI0OAkJLyogZ2V0IGRyaXZlciBpbmZvICAgICAgKi8KLSAKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFN0cnVjdHVyZSB1c2VkIHdpdGggaW9jdGwgY29tbWFuZHMgZm9yIHBlci1ib2FyZCBpbmZvcm1hdGlvbgotICoKLSAqIHBoeXNzaXplIGFuZCBtZW1zaXplIGRpZmZlciB3aGVuIGJvYXJkIGhhcyAid2luZG93ZWQiIG1lbW9yeQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBkaWdpX2luZm8gewotCXVuc2lnbmVkIGxvbmcJaW5mb19iZG51bTsJCS8qIEJvYXJkIG51bWJlciAoMCBiYXNlZCkgICovCi0JdW5zaWduZWQgbG9uZwlpbmZvX2lvcG9ydDsJCS8qIGlvIHBvcnQgYWRkcmVzcyAgICAgICAgICovCi0JdW5zaWduZWQgbG9uZwlpbmZvX3BoeXNhZGRyOwkJLyogbWVtb3J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mbGFncy0kKENPTkZJR19HU19GUEdBX0RFQlVHKQk6PSAtRERFQlVHCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvZ3NfZnBnYWJvb3QvUkVBRE1FIGIvZHJpdmVycy9zdGFnaW5nL2dzX2ZwZ2Fib290L1JFQURNRQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jZmE4NjI0Ci0tLSAvZGV2L251bGwKKysrIGIvZHJpdmVycy9zdGFnaW5nL2dzX2ZwZ2Fib290L1JFQURNRQpAQCAtMCwwICsxLDcxIEBACis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KK0xpbnV4IERyaXZlciBTb3VyY2UgZm9yIFhpbGlueCBGUEdBIGZpcm13YXJlIGRvd25sb2FkCis9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCitUQUJMRSBPRiBDT05URU5UUy4KKworMS4gIFNVTU1BUlkKKzIuICBCQUNLR1JPVU5ECiszLiAgREVTSUdOCis0LiAgSE9XIFRPIFVTRQorNS4gIFJFRkVSRU5DRQorCisxLiBTVU1NQVJZCisKKwktIERvd25sb2FkIFhpbGlueCBGUEdBIGZpcm13YXJlCisJLSBUaGlzIG1vZHVsZSBkb3dubG9hZHMgWGlsaW54IEZQR0EgZmlybXdhcmUgdXNpbmcgZ3BpbyBwaW5zLgorCisyLiBCQUNLR1JPVU5ECisKKwlBbiBGUEdBIChGaWVsZCBQcm9ncmFtbWFibGUgR2F0ZSBBcnJheSkgaXMgYSBwcm9ncmFtbWFibGUgaGFyZHdhcmUgdGhhdCBpcworCXVzZWQgaW4gdmFyaW91cyBhcHBsaWNhdGlvbnMuIEhhcmR3YXJlIGRlc2lnbiBuZWVkcyB0byBwcm9ncmFtbWVkIHRocm91Z2gKKwlhIGRlZ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RzEwMCBzcGVjaWZpYyBMU0IsIGluIHRoaXMgb3JkZXIgW2J5dGUwIHwgYnl0ZTFdLCBvdXQKKyAqLworc3RhdGljIGlubGluZSB2b2lkIGJ5dGUxX291dCh1bnNpZ25lZCBjaGFyIGRhdGEpCit7CisJbXBjODV4eF9ncGlvX3NldCgwLCAweDAwMDAwMEZGLCAodWludDMyX3QpIGJpdHN3YXAoZGF0YSkpOworfQorCisvKgorICogY29uZmlndXJhYmxlIHBlciBkZXZpY2UgdHlwZSBmb3IgZGlmZmVyZW50IEkvTyBjb25maWcKKyAqLworaW50IHhsX2luaXRfaW8odm9pZCkKK3sKKwlzdHJ1Y3QgZGV2aWNlX25vZGUgKm5wOworCWNvbnN0IHUzMiAqcF9yZWc7CisJaW50IHJlZywgY250OworCisJY250ID0gMDsKKwltZW1zZXQoJmdidXMsIDAsIHNpemVvZihzdHJ1Y3QgZ3Bpb2J1cykpOworCWZvcl9lYWNoX2NvbXBhdGlibGVfbm9kZShucCwgTlVMTCwgImZzbCxxb3JpcS1ncGlvIikgeworCQlwX3JlZyA9IG9mX2dldF9wcm9wZXJ0eShucCwgInJlZyIsIE5VTEwpOworCQlpZiAocF9yZWcgPT0gTlVMTCkKKwkJCWJyZWFrOworCQlyZWcgPSAoaW50KSAqcF9yZWc7CisJCWdidXMucltjbnRdID0gb2ZfaW9tYXAobnAsIDApOworCisJCWlmICghZ2J1cy5yW2NudF0pIHsKKwkJCXByX2Vycigibm90IGZpbmRkaW5nIGdwaW8gY2VsbC1pbmRleCAlZFxuIiwgY250KTsKKwkJCXJldHVybiAtRU5PREVWOworCQl9CisJCWNudCsrOworCX0KKwltcGM4NXh4X2dwaW9fc2V0X2RpcigwLCAweDAwMDJCRkZGLCAweDAwMDJCRkZGKTsKKwltcGM4NXh4X2dwaW9fc2V0X2RpcigxLCAweDAwMjQwMDYwLCAweDAwMjQwMDYwKTsKKworCWdidXMubmdwaW8gPSBjbnQ7CisKKwlyZXR1cm4gMDsKK30KKworCisjZ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3RybGVuKHByZWZpeCkgJiYKKwkJc3RybmNtcChzdHIsIHByZWZpeCwgc3RybGVuKHByZWZpeCkpID09IDA7Cit9CisKK3N0YXRpYyBpbmxpbmUgaW50IGNoZWNrX3Bvc3RmaXgoY29uc3QgY2hhciAqc3RyLCBjb25zdCBjaGFyICpwb3N0Zml4KQoreworCXJldHVybiBzdHJsZW4oc3RyKSA+IHN0cmxlbihwb3N0Zml4KSAmJgorCQlzdHJjbXAoc3RyICsgc3RybGVuKHN0cikgLSBzdHJsZW4ocG9zdGZpeCksIHBvc3RmaXgpID09IDA7Cit9CisKK3N0YXRpYyBpbnQgZHVtcF9jaGFubmVscyhjb25zdCBjaGFyICpkZXZfZGlyX25hbWUpCit7CisJRElSICpkcDsKKwljb25zdCBzdHJ1Y3QgZGlyZW50ICplbnQ7CisJZHAgPSBvcGVuZGlyKGRldl9kaXJfbmFtZSk7CisJaWYgKGRwID09IE5VTEwpCisJCXJldHVybiAtZXJybm87CisJd2hpbGUgKGVudCA9IHJlYWRkaXIoZHApLCBlbnQgIT0gTlVMTCkKKwkJaWYgKGNoZWNrX3ByZWZpeChlbnQtPmRfbmFtZSwgImluXyIpICYmCisJCSAgICBjaGVja19wb3N0Zml4KGVudC0+ZF9uYW1lLCAiX3JhdyIpKSB7CisJCQlwcmludGYoIiAgICUtMTBzXG4iLCBlbnQtPmRfbmFtZSk7CisJCX0KKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IGR1bXBfb25lX2RldmljZShjb25zdCBjaGFyICpkZXZfZGlyX25hbWUpCit7CisJY2hhciBuYW1lW0lJT19NQVhfTkFNRV9MRU5HVEhdOworCWludCBkZXZfaWR4OworCisJc3NjYW5mKGRldl9kaXJfbmFtZSArIHN0cmxlbihpaW9fZGlyKSArIHN0cmxlbih0eXBlX2RldmljZSksCisJCQkiJWkiLCAmZGV2X2lkeCk7CisJcmVhZF9zeXNmc19zdHJpbmcoIm5hbWUiLCBkZXZfZGlyX25hbWUsIG5hbWUpOworCX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SAqLCBCWVRFICopOwotaW50ICBTc2ZkY19EX1dyaXRlU2VjdF9QSU8oc3RydWN0IHVzX2RhdGEgKiwgQllURSAqLCBCWVRFICopOworaW50ICBTc2ZkY19EX1JlYWRTZWN0X0RNQShzdHJ1Y3QgdXNfZGF0YSAqLCB1OCAqLCB1OCAqKTsKK2ludCAgU3NmZGNfRF9SZWFkU2VjdF9QSU8oc3RydWN0IHVzX2RhdGEgKiwgdTggKiwgdTggKik7CitpbnQgIFNzZmRjX0RfV3JpdGVTZWN0X0RNQShzdHJ1Y3QgdXNfZGF0YSAqLCB1OCAqLCB1OCAqKTsKK2ludCAgU3NmZGNfRF9Xcml0ZVNlY3RfUElPKHN0cnVjdCB1c19kYXRhICosIHU4ICosIHU4ICopOwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50ICBDaGVja19EX1JlYWRFcnJvcihCWVRFICopOwotaW50ICBDaGVja19EX0NvcnJlY3QoQllURSAqLCBCWVRFICopOwotaW50ICBDaGVja19EX0NJU2RhdGEoQllURSAqLCBCWVRFICopOwotdm9pZCBTZXRfRF9SaWdodEVDQyhCWVRFICopOworaW50ICBDaGVja19EX1JlYWRFcnJvcih1OCAqKTsKK2ludCAgQ2hlY2tfRF9Db3JyZWN0KHU4ICosIHU4ICopOworaW50ICBDaGVja19EX0NJU2RhdGEodTggKiwgdTggKik7Cit2b2lkIFNldF9EX1JpZ2h0RUNDKHU4ICopOwogCiAvKgogICogU01JTEVDQy5jCiAgKi8KLXZvaWQgY2FsY3VsYXRlX2VjYyhCWVRFICosIEJZVEUgKiwgQllURSAqLCBCWVRFICosIEJZVEUgKik7Ci1CWVRFIGNvcnJlY3RfZGF0YShCWVRFICosIEJZVEUgKiwgQllURSwgICBCWVRFLCAgIEJZVEUpOwotaW50ICBfQ29ycmVjdF9EX1N3RUNDKEJZVEUgKiwgQllURSAqLCBCWVRFICopOwotdm9pZCBfQ2FsY3VsYXRlX0RfU3dFQ0MoQ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ICAgICAgU0RfQmxvY2tfTXVsdDsKKwl1OCAgICAgICAgU0RfUkVBRF9CTF9MRU47CisJdTE2ICAgICAgICBTRF9DX1NJWkU7CisJdTggICAgICAgIFNEX0NfU0laRV9NVUxUOwogCiAJLyogU0QvTU1DIE5ldyBzcGVjLiAqLwotCUJZVEUgICAgICAgIFNEX1NQRUNfVkVSOwotCUJZVEUgICAgICAgIFNEX0NTRF9WRVI7Ci0JQllURSAgICAgICAgU0QyMF9ISUdIX0NBUEFDSVRZOwotCURXT1JEICAgICAgIEhDX0NfU0laRTsKLQlCWVRFICAgICAgICBNTUNfU1BFQ19WRVI7Ci0JQllURSAgICAgICAgTU1DX0J1c1dpZHRoOwotCUJZVEUgICAgICAgIE1NQ19ISUdIX0NBUEFDSVRZOworCXU4ICAgICAgICBTRF9TUEVDX1ZFUjsKKwl1OCAgICAgICAgU0RfQ1NEX1ZFUjsKKwl1OCAgICAgICAgU0QyMF9ISUdIX0NBUEFDSVRZOworCXUzMiAgICAgICBIQ19DX1NJWkU7CisJdTggICAgICAgIE1NQ19TUEVDX1ZFUjsKKwl1OCAgICAgICAgTU1DX0J1c1dpZHRoOworCXU4ICAgICAgICBNTUNfSElHSF9DQVBBQ0lUWTsKIAogCS8qIC0tLS0tIE1TIENvbnRyb2wgRGF0YSAtLS0tLS0tLS0tLS0tLS0tICovCi0JQk9PTEVBTiAgICAgICAgICAgICBNU19TV1dQOwotCURXT1JEICAgICAgICAgICAgICAgTVNQX1RvdGFsQmxvY2s7CisJYm9vbCAgICAgICAgICAgICBNU19TV1dQOworCXUzMiAgICAgICAgICAgICAgIE1TUF9Ub3RhbEJsb2NrOwogCS8qIE1TX0xpYkNvbnRyb2wgICAgICAgTVNfTGliOyAqLwotCUJPT0xFQU4gICAgICAgICAgICAgTVNfSXNSV1BhZ2U7Ci0JV09SRCAgICAgICAgICAgICAgICBNU19Nb2RlbDsKKwlib29sICAgICAgICAgICAgIE1TX0lzUldQYWdlOworCXUxNiAgICAgICAgICAg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fUE9ESEQ1MDAsICAgICAgIlBPREhENTAwIiwgICAgICAiUE9EIEhENTAwIiwgICAgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAotCXsgTElORTZfQklUX1BPRFNUVURJT19HWCwgICJQT0RTdHVkaW9HWCIsICAgIlBPRCBTdHVkaW8gR1giLCAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7IExJTkU2X0JJVF9QT0RTVFVESU9fVVgxLCAiUE9EU3R1ZGlvVVgxIiwgICJQT0QgU3R1ZGlvIFVYMSIsICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfUE9EU1RVRElPX1VYMiwgIlBPRFN0dWRpb1VYMiIsICAiUE9EIFN0dWRpbyBVWDIiLCAgIExJTkU2X0JJVF9QQ00gICAgICAgICAgICAgICB9LAotCXsgTElORTZfQklUX1BPRFgzLCAgICAgICAgICJQT0RYMyIsICAgICAgICAgIlBPRCBYMyIsICAgICAgICAgICBMSU5FNl9CSVRfUENNICAgICAgICAgICAgICAgfSwKLQl7IExJTkU2X0JJVF9QT0RYM0xJVkUsICAgICAiUE9EWDNMaXZlIiwgICAgICJQT0QgWDMgTGl2ZSIsICAgICAgTElORTZfQklUX1BDTSAgICAgICAgICAgICAgIH0sCi0JeyBMSU5FNl9CSVRfUE9EWFQsICAgICAgICAgIlBPRHh0IiwgICAgICAgICAiUE9EeHQiLCAgICAgICAgICAgIExJTkU2X0JJVF9DT05UUk9MX1BDTV9IV01PTiB9LAotCXsgTElORTZfQklUX1BPRFhUTElWRSwgICAgICJQT0R4dExpdmUiLCAgICAgIlBPRHh0IExpdmUiLCAgICAgICBMSU5FNl9CSVRfQ09OVFJPTF9QQ01fSFdNT04gfSwKLQl7IExJTkU2X0JJVF9QT0RYVFBSTywgICAgICAiUE9EeHRQcm8iLCAgICAgICJQT0R4dCBQcm8iLCAgICAgICAgTElORTZfQklUX0NPTlRST0xfUENNX0hXTU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Ugbm8gaW50ZXJlc3QgaW4gbWVyZ2luZyBhIGRyaXZlciB3aXRoIHN1Y2ggYSBoYWNrLgorCis+ICsgICAgIG5vdF92YWxpZCA9IDE7Cis+ICsgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspIHsKKz4gKyAgICAgICAgICAgICBpZiAoaW5mby0+YmRfYWRkcltpXSAhPSAweDAwKSB7Cis+ICsgICAgICAgICAgICAgICAgICAgICBub3RfdmFsaWQgPSAwOworPiArICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Cis+ICsgICAgICAgICAgICAgfSAgIAorPiArICAgICB9CisKK0FueWJvZHkgZXZlcnkgaGVhcmQgb2YgbWVtY21wIG9yIGJhY21wIGFuZCBCREFERFJfQU5ZPworCis+ICsgICAgICAgICAgICAgaWYgKG5vdF92YWxpZCkgeworPiArICAgICAgICAgICAgICAgICAgICAgZGV2X2luZm8oaW5mby0+ZGV2LCAiVmFsaWQgYmx1ZXRvb3RoIGFkZHJlc3Mgbm90IGZvdW5kLCIKKz4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIHNldHRpbmcgc29tZSByYW5kb21cbiIpOworPiArICAgICAgICAgICAgICAgICAgICAgLyogV2hlbiBhZGRyZXNzIGlzIG5vdCB2YWxpZCwgdXNlIHNvbWUgcmFuZG9tICovCis+ICsgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoaW5mby0+YmRfYWRkciwgbm9raWFfb3VpLCAzKTsKKz4gKyAgICAgICAgICAgICAgICAgICAgIGdldF9yYW5kb21fYnl0ZXMoaW5mby0+YmRfYWRkciArIDMsIDMpOworPiArICAgICAgICAgICAgIH0KKworCitBbmQgd2h5IGRvZXMgZXZlcnkgc2luZ2xlIGNoaXAgZmlybXdhcmUgZG9lcyB0aGlzIGRpZmZlcmVudGx5LiBTZXJpb3VzbHksIHRoaXMgaXMgYSBtZXNzLgorCis+ICt2b2lkIGhjaV9oNHBfcGFyc2VfZndfZXZlbnQoc3RydWN0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hKTsKKwkJcmV0ID0gSVJRX0hBTkRMRUQ7CisJfQorCisJcmV0dXJuIHJldDsKK30KKworc3RhdGljIGlycXJldHVybl90IGhjaV9oNHBfd2FrZXVwX2ludGVycnVwdChpbnQgaXJxLCB2b2lkICpkZXZfaW5zdCkKK3sKKwlzdHJ1Y3QgaGNpX2g0cF9pbmZvICppbmZvID0gZGV2X2luc3Q7CisJaW50IHNob3VsZF93YWtldXA7CisJc3RydWN0IGhjaV9kZXYgKmhkZXY7CisKKwlpZiAoIWluZm8tPmhkZXYpCisJCXJldHVybiBJUlFfSEFORExFRDsKKworCXNob3VsZF93YWtldXAgPSBncGlvX2dldF92YWx1ZShpbmZvLT5ob3N0X3dha2V1cF9ncGlvKTsKKwloZGV2ID0gaW5mby0+aGRldjsKKworCWlmICghdGVzdF9iaXQoSENJX1JVTk5JTkcsICZoZGV2LT5mbGFncykpIHsKKwkJaWYgKHNob3VsZF93YWtldXAgPT0gMSkKKwkJCWNvbXBsZXRlX2FsbCgmaW5mby0+dGVzdF9jb21wbGV0aW9uKTsKKworCQlyZXR1cm4gSVJRX0hBTkRMRUQ7CisJfQorCisJQlRfREJHKCJncGlvIGludGVycnVwdCAlZCIsIHNob3VsZF93YWtldXApOworCisJLyogQ2hlY2sgaWYgd2VlIGhhdmUgbWlzc2VkIHNvbWUgaW50ZXJydXB0cyAqLworCWlmIChpbmZvLT5yeF9lbmFibGVkID09IHNob3VsZF93YWtldXApCisJCXJldHVybiBJUlFfSEFORExFRDsKKworCWlmIChzaG91bGRfd2FrZXVwKQorCQloY2lfaDRwX2VuYWJsZV9yeChpbmZvKTsKKwllbHNlCisJCWhjaV9oNHBfZGlzYWJsZV9yeChpbmZvKTsKKworCXJldHVybiBJUlFfSEFORExFRDsKK30KKworc3RhdGljIGlubGluZSB2b2lkIGhjaV9oNHBfc2V0X3BtX2xpbWl0cyhzdHJ1Y3QgaGNpX2g0cF9pbmZvICppbmZvLCBib29sIHNldCkKK3sKKwlzdHJ1Y3Qga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W5nIGEgY29tcGxldGUgc3luY3JvIHNjYW4gYmVmb3JlIGNvbmNsdWRlCi0gICAgICAgICAgICAgICAgICogICAgdGhlcmUgYXJlIG5vIGludGVyZXN0aW5nIGNlbGwgYW5kIHRvIGNyZWF0ZSBhCi0gICAgICAgICAgICAgICAgICogICAgbmV3IG9uZS4gSW4gdGhpcyBjYXNlIHRoZSBsaW5rIHN0YXRlIGlzCi0gICAgICAgICAgICAgICAgICogICAgSUVFRTgwMjExX05PTElOSyB1bnRpbCB3ZSBmb3VuZCBhbiBpbnRlcmVzdGluZyBjZWxsLgotICAgICAgICAgICAgICAgICAqICAgIElmIHNvIHRoZSBpZWVlODAyMV9uZXdfbmV0LCBjYWxsZWQgYnkgdGhlIFJYIHBhdGgKLSAgICAgICAgICAgICAgICAgKiAgICB3aWxsIHNldCB0aGUgc3RhdGUgdG8gSUVFRTgwMjExX0xJTktFRCwgc28gd2Ugc3RvcAotICAgICAgICAgICAgICAgICAqICAgIHNjYW5uaW5nCi0gICAgICAgICAgICAgICAgICogMi0gV2UgYXJlIGxpbmtlZCBhbmQgdGhlIHJvb3QgdXNlcyBydW4gaXdsaXN0IHNjYW4uCi0gICAgICAgICAgICAgICAgICogICAgU28gd2Ugc3dpdGNoIHRvIElFRUU4MDIxMV9MSU5LRURfU0NBTk5JTkcgdG8gcmVtZW1iZXIKLSAgICAgICAgICAgICAgICAgKiAgICB0aGF0IHdlIGFyZSBzdGlsbCBsb2dpY2FsbHkgbGlua2VkIChub3QgaW50ZXJlc3RlZCBpbgotICAgICAgICAgICAgICAgICAqICAgIG5ldyBuZXR3b3JrIGV2ZW50cywgZGVzcGl0ZSBmb3IgdXBkYXRpbmcgdGhlIG5ldCBsaXN0LAotICAgICAgICAgICAgICAgICAqICAgIGJ1dCB3ZSBhcmUgdGVtcG9yYXJpbHkgJ3VubGlua2VkJyBhcyB0aGUgZHJpdmVyIHNoYWxsCi0gICAgICAgICAgICAgICAgICogICAgbm90IGZpbHRlciBSWCBmcmF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EVEIGN1c3RvbWl6YXRpb24uCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitlbnVtIGxlZF9zdHJhdGVneV84MTg1IHsKKwlTV19MRURfTU9ERTAsCisJU1dfTEVEX01PREUxLAorCUhXX0xFRCwgLyogSFcgY29udHJvbCAyIExFRHMsIExFRDAgYW5kIExFRDEgKHRoZXJlIGFyZSA0IGRpZmZlcmVudAorCQkgKiBjb250cm9sIG1vZGVzKS4gKi8KK307CiAKLS8vWUosbW9kaWZpZWQsMDgwODI4LGVuZAorZW51bSBydF9yZl9wb3dlcl9zdGF0ZSB7CisJUkZfT04sCisJUkZfU0xFRVAsCisJUkZfT0ZGCit9OwogCi0vL2J5IGFteSBmb3IgbGVkCi0vLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0vLyBMRUQgY3VzdG9taXphdGlvbi4KLS8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KK2VudW0gX1JlYXNvbkNvZGUgeworCXVuc3BlY19yZWFzb24gPSAweDEsCisJYXV0aF9ub3RfdmFsaWQgPSAweDIsCisJZGVhdXRoX2x2X3NzID0gMHgzLAorCWluYWN0aXZpdHkgPSAweDQsCisJYXBfb3ZlcmxvYWQgPSAweDUsCisJY2xhc3MyX2VyciA9IDB4NiwKKwljbGFzczNfZXJyID0gMHg3LAorCWRpc2FzX2x2X3NzID0gMHg4LAorCWFzb2Nfbm90X2F1dGggPSAweDksCiAKLXR5cGVkZWYJZW51bSBfTEVEX1NUUkFURUdZXzgxODV7Ci0JU1dfTEVEX01PREUwLCAvLwotCVNXX0xFRF9NT0RFMSwgLy8KLQlIV19MRUQsIC8vIEhXIGNvbnRyb2wgMiBMRURzLCB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CeXRlczsKLQl1bnNpZ25lZCBsb25nIAkJICAgIE51bVR4T2tCeXRlc1RvdGFsOwotICAgICAgICB1OCAgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdEZhaWxUeFJhdGU7Ci0gICAgICAgIGxvbmcgICAgICAgICAgICAgICAgICAgICAgICBMYXN0RmFpbFR4UmF0ZVNTOwotICAgICAgICB1OCAgICAgICAgICAgICAgICAgICAgICAgICAgRmFpbFR4UmF0ZUNvdW50OwotICAgICAgICB1MzIgICAgICAgICAgICAgICAgICAgICAgICAgTGFzdFR4VGhyb3VnaHB1dDsKLSAgICAgICAgLy9mb3IgdXAgcmF0ZQotICAgICAgICB1bnNpZ25lZCBzaG9ydCAgICAgICAgICBiVHJ5dXBpbmc7Ci0gICAgICAgIHU4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDdXJyVHhSYXRlOyAgICAgLy90aGUgcmF0ZSBiZWZvcmUgdXAKLSAgICAgICAgdTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEN1cnJSZXRyeVJhdGU7Ci0gICAgICAgIHUxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcnl1cGluZ0NvdW50OwotICAgICAgICB1OCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJ5RG93bkNvdW50TG93RGF0YTsKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyeXVwaW5nQ291bnROb0RhdGE7CisJLyogYnkgYW15IGZvciBhbnRlbm5hIHtieSBhbXkgMDgwMzEyICovCiAKLSAgICAgICAgdTggICAgICAgICAgICAgICAgICBDdXJyZW50T3BlcmFSYXRlOwotLy9ieSBhbXkgZm9yIHJhdGUgYWRhcHRpdmUKLS8vYnkgYW15IDA4MDMxMn0KLS8vCXNob3J0IHdxX2h1cnJ5dXA7Ci0vLwlzdHJ1Y3Qgd29ya3F1ZXVlX3N0cnVjdCAqd29ya3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8gdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLiwKLSAqIDUxIEZyYW5rbGluIFN0cmVldCwgRmlmdGggRmxvb3IsIEJvc3RvbiwgTUEgMDIxMTAsIFVTQQotICoKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBfTElOVVhfSVBfSAotI2RlZmluZSBfTElOVVhfSVBfSAotCi0vKiBTT0xfSVAgc29ja2V0IG9wdGlvbnMgKi8KLQotI2RlZmluZSBJUFRPU19UT1NfTUFTSwkJMHgxRQotI2RlZmluZSBJUFRPU19UT1ModG9zKQkJKCh0b3MpJklQVE9TX1RPU19NQVNLKQotI2RlZmluZQlJUFRPU19MT1dERUxBWQkJMHgxMAotI2RlZmluZQlJUFRPU19USFJPVUdIUFVUCTB4MDgKLSNkZWZpbmUJSVBUT1NfUkVMSUFCSUxJVFkJMHgwNAotI2RlZmluZQlJUFRPU19NSU5DT1NUCQkweDAyCi0KLSNkZWZpbmUgSVBUT1NfUFJFQ19NQVNLCQkweEUwCi0jZGVmaW5lIElQVE9TX1BSRUModG9zKQkJKCh0b3MpJklQVE9TX1BSRUNfTUFTSykKLSNkZWZpbmUgSVBUT1NfUFJFQ19ORVRDT05UUk9MICAgICAgICAgICAweGUwCi0jZGVmaW5lIElQVE9TX1BSRUNfSU5URVJORVRDT05UUk9MICAgICAgMHhjMAotI2RlZmluZSBJUFRPU19QUkVDX0NSSVRJQ19FQ1AgICAgICAgICAgIDB4YTAKLSNkZWZpbmUgSVBUT1NfUFJFQ19GTEFTSE9WRVJSSURFICAgICAgICAweDgwCi0jZGVmaW5lIElQVE9TX1BSRUNfRkxBU0ggICAgICAgICAgICAgICAgMHg2MAotI2RlZmluZSBJUFRPU19QUkVDX0lNTUVESUFURSAgICAgICAgICAgIDB4NDAKLSNkZWZpbmUgSVBUT1NfUFJFQ19QUklPUkl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QgKiBpICsgNV0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs0ICogaSArIDJdOyBFX0tFWVs0ICogaSArIDZdID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNCAqIGkgKyAzXTsgRV9LRVlbNCAqIGkgKyA3XSA9IHQ7ICAgIFwKLX0KLQotI2RlZmluZSBsb29wNihpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLXsgICB0ID0gcm90cih0LCAgOCk7IHQgPSBsc19ib3godCkgXiByY29fdGFiW2ldOyAgICBcCi0gICAgdCBePSBFX0tFWVs2ICogaV07ICAgICBFX0tFWVs2ICogaSArIDZdID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNiAqIGkgKyAxXTsgRV9LRVlbNiAqIGkgKyA3XSA9IHQ7ICAgIFwKLSAgICB0IF49IEVfS0VZWzYgKiBpICsgMl07IEVfS0VZWzYgKiBpICsgOF0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs2ICogaSArIDNdOyBFX0tFWVs2ICogaSArIDldID0gdDsgICAgXAotICAgIHQgXj0gRV9LRVlbNiAqIGkgKyA0XTsgRV9LRVlbNiAqIGkgKyAxMF0gPSB0OyAgIFwKLSAgICB0IF49IEVfS0VZWzYgKiBpICsgNV07IEVfS0VZWzYgKiBpICsgMTFdID0gdDsgICBcCi19Ci0KLSNkZWZpbmUgbG9vcDgoaSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi17ICAgdCA9IHJvdHIodCwgIDgpOyA7IHQgPSBsc19ib3godCkgXiByY29fdGFiW2ldOyAgXAotICAgIHQgXj0gRV9LRVlbOCAqIGldOyAgICAgRV9LRVlbOCAqIGkgKyA4XSA9IHQ7ICAgIFwKLSAgICB0IF49IEVfS0VZWzggKiBpICsgMV07IEVfS0VZWzggKiBpICsgOV0gPSB0OyAgICBcCi0gICAgdCBePSBFX0tFWVs4ICogaSArIDJdOyBFX0tFWVs4ICogaSArIDEwXSA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WU4MDIxMS9ydGw4MTl4X0JBUHJvYy5jCkBAIC0xMyw3ICsxMyw3IEBACiAgKgkgICAgIHUxNgkJCVRpbWUgLy9pbmRpY2F0ZSB0aW1lIGRlbGF5LgogICogIG91dHB1dDogIG5vbmUKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBBY3RpdmF0ZUJBRW50cnkoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBCQV9SRUNPUkQgcEJBLCB1MTYgVGltZSkKK3N0YXRpYyB2b2lkIEFjdGl2YXRlQkFFbnRyeShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgUEJBX1JFQ09SRCBwQkEsIHUxNiBUaW1lKQogewogCXBCQS0+YlZhbGlkID0gdHJ1ZTsKIAlpZihUaW1lICE9IDApCkBAIC0yNSw3ICsyNSw3IEBACiAgKiAgIGlucHV0OiAgUEJBX1JFQ09SRAkJCXBCQSAgLy9CQSBlbnRyeSB0byBiZSBkaXNhYmxlZAogICogIG91dHB1dDogIG5vbmUKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBEZUFjdGl2YXRlQkFFbnRyeSggc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBCQV9SRUNPUkQgcEJBKQorc3RhdGljIHZvaWQgRGVBY3RpdmF0ZUJBRW50cnkoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIFBCQV9SRUNPUkQgcEJBKQogewogCXBCQS0+YlZhbGlkID0gZmFsc2U7CiAJZGVsX3RpbWVyX3N5bmMoJnBCQS0+VGltZXIpOwpAQCAtMzcsNyArMzcsNyBAQAogICogIG91dHB1dDogIG5vbmUKICAqICBub3RpY2U6ICBBcyBQVFhfVFNfUkVDT1JEIHN0cnVjdHVyZSB3aWxsIGJlIGRlZmluZWQgaW4gUU9TLCBzbyB3YWl0IHRvIGJlIG1lcmdlZC4gLy9GSVhNRQogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi11OCBUeFRzRGVsZXRlQkEoIHN0cnVjdCBpZWVlODAyMTFfZGV2aWNlICppZWVlLCBQVFhfVFNfUkVDT1JECXBUeFRzKQorc3RhdGljIHU4IFR4VHNEZWxldGVCQShzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgUFRYX1RTX1JFQ09SRCBwVHhUcykKIHsKIAlQQkFfUkVDT1JECQlwQWRtaXR0ZWRCYSA9ICZwVHhUcy0+VHhBZG1pdHRlZEJBUmVjb3JkOyAgLy9UaGVzZSB0d28gQkEgZW50cmllcyBtdXN0IGV4aXN0IGluIFRTIHN0cnVjdHVyZQogCVBCQV9SRUNPUkQJCXBQZW5kaW5nQmEgPSAmcFR4VHMtPlR4UGVuZGluZ0JBUmVjb3JkOwpAQCAtNjcsNyArNjcsNyBAQAogICogIG91dHB1dDogIG5vbmUKICAqICBub3RpY2U6ICBBcyBQUlhfVFNfUkVDT1JEIHN0cnVjdHVyZSB3aWxsIGJlIGRlZmluZWQgaW4gUU9TLCBzbyB3YWl0IHRvIGJlIG1lcmdlZC4gLy9GSVhNRSwgc2FtZSB3aXRoIGFib3ZlCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXU4IFJ4VHNEZWxldGVCQSggc3RydWN0IGllZWU4MDIxM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Wx1ZSA9IGZhbHNlOwogCVBSVF9ISUdIX1RIUk9VR0hQVVQJIHBIVEluZm8gPSBpZWVlLT5wSFRJbmZvOwpAQCAtMzc2LDcgKzM3Niw3IEBACiAgKiAgcmV0dXJuOgogICogIG5vdGljZToKICAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBIVElPVFBlZXJEZXRlcm1pbmUoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUpCitzdGF0aWMgdm9pZCBIVElPVFBlZXJEZXRlcm1pbmUoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUpCiB7CiAJUFJUX0hJR0hfVEhST1VHSFBVVAlwSFRJbmZvID0gaWVlZS0+cEhUSW5mbzsKIAlzdHJ1Y3QgaWVlZTgwMjExX25ldHdvcmsgKm5ldCA9ICZpZWVlLT5jdXJyZW50X25ldHdvcms7CkBAIC00MTMsNyArNDEzLDcgQEAKICAqICBvdXRwdXQ6ICBub25lCiAgKiAgcmV0dXJuOiAgcmV0dXJuIDEgaWYgZHJpdmVyIHNob3VsZCBkZWNsYXJlIE1DUzEzIG9ubHkob3RoZXJ3aXNlIHJldHVybiAwKQogICAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdTggSFRJT1RBY3RJc0Rpc2FibGVNQ1MxNChzdHJ1Y3QgaWVlZTgwMjExX2RldmljZSAqaWVlZSwgdTggKlBlZXJNYWNBZGRyKQorc3RhdGljIHU4IEhUSU9UQWN0SXNEaXNhYmxlTUNTMTQoc3RydWN0IGllZWU4MDIxMV9kZXZpY2UgKmllZWUsIHU4ICpQZWVyTWFjQWRkcikKIHsKIAl1OCByZ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kbSkpCisjZGVmaW5lIHJ0bF9zZWMocnRscHJpdikJKCYoKHJ0bHByaXYpLT5zZWMpKQorI2RlZmluZSBydGxfZG0ocnRscHJpdikJCSgmKChydGxwcml2KS0+ZG0pKQogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgIEJsdWV0b290aCBDby1leGlzdGFuY2UgUmVsYXRlZAogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogZW51bSBidF9hbnRfbnVtIHsKLSAgICAgICAgQU5UX1gyID0gMCwKLSAgICAgICAgQU5UX1gxID0gMSwKKwlBTlRfWDIgPSAwLAorCUFOVF9YMSA9IDEsCiB9OwogCiBlbnVtIGJ0X2NvX3R5cGUgewotICAgICAgICBCVF8yV0lSRSA9IDAsCi0gICAgICAgIEJUX0lTU0NfM1dJUkUgPSAxLAotICAgICAgICBCVF9BQ0NFTCA9IDIsCi0gICAgICAgIEJUX0NTUl9CQzQgPSAzLAotICAgICAgICBCVF9DU1JfQkM4ID0gNCwKLSAgICAgICAgQlRfUlRMODc1NiA9IDUsCi0gICAgICAgIEJUX1JUTDg3MjNBID0gNiwKLSAgICAgICAgQlRfUlRMODgyMUEgPSA3LAotICAgICAgICBCVF9SVEw4NzIzQiA9IDgsCi0gICAgICAgIEJUX1JUTDgxOTJFID0gOSwKLSAgICAgICAgQlRfUlRMODgxMkEgPSAxMSwKKwlCVF8yV0lSRSA9IDAsCisJQlRfSVNTQ18zV0lSRSA9IDEsCisJQlRfQUNDRUwgPSAyLAorCUJUX0NTUl9CQzQgPSAzLAorCUJUX0NTUl9CQzggPSA0LAorCUJUX1JUTDg3NTYgPSA1LAorCUJUX1JUTDg3MjNBID0gNiwKKwlCVF9SVEw4ODIxQSA9IDcsCisJQlRfUlRMODcyM0IgPSA4LAorCUJUX1JUTDgxOTJFID0gOSwKKwlCVF9SVEw4ODEyQSA9IDExLAogfTsKIAotZW51bSBidF90b3RhbF9hbnRfbnVteworZW51b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gotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUE9SVF8xNkMxMDVYOwotICAgICAgICAgICAgICAgY2FzZSBESVJfVUFSVF8xNkMxMDUwQToKLSAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICBpZiAobXRwdC0+cG9ydC5saW5lIDwgMikKLSAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfMTZDMTA1WEE7Ci0gICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgaWYgKG10cHQtPmRldmljZS0+ZGV2aWNlX2lkICYgMHg1MCkKLSAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQT1JUXzE2QzU1WDsKLSAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfMTZDMTA1WDsKLSAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICB9Ki8KLSAgICAgICAgICAgICAgIHJldHVybiBQT1JUXzE2QzEwNVhBOwotICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBPUlRfVU5LTk9XTjsKLSAgICAgICAgfQotCi19Ci1zdGF0aWMgaW50IGdldF9kZWVwX2ZpZm8oc3RydWN0IHNiX3VhcnRfcG9ydCAqcG9ydCkKLXsKLQlpbnQgYWZyX3N0YXR1cyA9IDA7Ci0JYWZyX3N0YXR1cyA9IHNiMTA1NF9nZXRfcmVnaXN0ZXIocG9ydCwgUEFHRV80LCBTQjEwNVhfQUZSKTsKLQlyZXR1cm4gYWZyX3N0YXR1czsKLX0KLQotc3RhdGljIGludCBzZXRfYXV0b19ydHMoc3RydWN0IHNiX3VhcnRfcG9ydCA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i0JLyogRW5hYmxlIFBDSSBpbnRlcnJ1cHQgKi8KLQlhZGRyID0gc2JkZXYtPm9wdGlvbl9yZWdfYWRkciArIE1QX09QVFJfSU1SMDsKLQlmb3Ioaj0wOyBqIDwgKHNiZGV2LT5ucl9wb3J0cy84KSsxOyBqKyspCi0JewotCQlpZiAoc2JkZXYtPnBvbGxfdHlwZSA9PSBUWVBFX0lOVEVSUlVQVCkKLQkJewotCQkJb3V0YigweGZmLGFkZHIgK2opOwotCQl9Ci0JfQotCXNiZGV2Kys7Ci0KLQlyZXR1cm4gMDsKLX0KLQotc3RhdGljIGludCBfX2luaXQgbXVsdGlfaW5pdCh2b2lkKQotewotCWludCByZXQsIGk7Ci0Jc3RydWN0IHBjaV9kZXYgICpkZXYgPSBOVUxMOwotCi0JaWYoZmNyX2NvdW50PT0wKQotCXsKLQkJZm9yKGk9MDtpPDI1NjtpKyspCi0JCXsKLQkJCWZjcl9hcnJbaV0gPSAweDAxOwotCQkJCi0JCX0KLQl9Ci0JaWYoZGVlcF9jb3VudD09MCkKLQl7Ci0JCWZvcihpPTA7aTwyNTY7aSsrKQotCQl7Ci0JCQlkZWVwW2ldID0gMTsKLQkJCQotCQl9Ci0JfQotCWlmKHJ0cl9jb3VudD09MCkKLSAgICAgICAgewotICAgICAgICAgICAgICAgIGZvcihpPTA7aTwyNTY7aSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJ0cltpXSA9IDB4MTA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0JaWYodHRyX2NvdW50PT0wKQotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yKGk9MDtpPDI1NjtpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdHRyW2ldID0gMHgzODsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi1wcmludGsoIk1VTFRJIElOSVRcbiIpOwotCWZvciggaT0wOyBpPCBtc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gJiAoQ0JBVUQgfCBDQkFVREVYKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjkyMTYwMCAgICA6IGJhdWQgPSA5MjE2MDA7ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI0NjA4MDAgICAgOiBiYXVkID0gNDYwODAwOyAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMjMwNDAwICAgIDogYmF1ZCA9IDIzMDQwMDsgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjExNTIwMCAgICA6IGJhdWQgPSAxMTUyMDA7ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI1NzYwMCAgICAgOiBiYXVkID0gNTc2MDA7ICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMzg0MDAgICAgIDogYmF1ZCA9IDM4NDAwOyAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjE5MjAwICAgICA6IGJhdWQgPSAxOTIwMDsgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI5NjAwICAgICAgOiBiYXVkID0gOTYwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNDgwMCAgICAgIDogYmF1ZCA9IDQ4MDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjI0MDAgICAgICA6IGJhdWQgPSAyNDAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxODAwICAgICAgOiBiYXVkID0gMTgwMDsgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTIwMCAgICAgIDogYmF1ZCA9IDEyMDA7ICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjYwMCAgICAgICA6IGJhdWQgPSA2MDA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIzMDAgICAgICAgOiBiYXVkID0gMzAwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQjIwMCAgICAgICA6IGJhdWQgPSAyMDA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEIxNTAgICAgICAgOiBiYXVkID0gMTUwOyAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCMTM0ICAgICAgIDogYmF1ZCA9IDEzNDsgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWNhc2UgQjExMCAgICAgICA6IGJhdWQgPSAxMTA7ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIAljYXNlIEI3NSAgICAgICAgOiBiYXVkID0gNzU7ICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAJY2FzZSBCNTAgICAgICAgIDogYmF1ZCA9IDUwOyAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgCWRlZmF1bHQgICAgICAgICA6IGJhdWQgPSA5NjAwOyAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChiYXVkID09IDM4NDAwKQotICAgICAgICAgICAgICAgICAgICAgICAgYmF1ZCA9IGFsdGJhdWQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYmF1ZCA9PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgYmF1ZCA9IDk2MDA7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYmF1ZCA+PSBtaW4gJiYgYmF1ZCA8PSBtYXgpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmF1ZDsKLQotICAgICAgICAgICAgICAgIHRlcm1pb3MtPmNfY2ZsYWcgJj0gfkNCQVVEOwotICAgICAgICAgICAgICAgIGlmIChvbGQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlcm1pb3MtPmNfY2ZsYWcgfD0gb2xkLT5jX2NmbGFnICYgQ0JBVUQ7Ci0gIC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ICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi0JX3BzbGljX2hhbmRsZSAgPSAgX2FkYXB0ZXItPnBmcmVlX3NsaWNfaGFuZGxlczsgICAgICAgICAgICAgICAgIFwKLQlpZiAoX3BzbGljX2hhbmRsZSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCQlfYWRhcHRlci0+cGZyZWVfc2xpY19oYW5kbGVzID0gX3BzbGljX2hhbmRsZS0+bmV4dDsgICAgIFwKLQl9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJl9hZGFwdGVyLT5oYW5kbGVfbG9jay5sb2NrLCAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi19Ci0KLSNkZWZpbmUgU0xJQ19GUkVFX1NMSUNfSEFORExFKF9hZGFwdGVyLCBfcHNsaWNfaGFuZGxlKSAgICAgICAgICAgICAgICAgIFwKLXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlfcHNsaWNfaGFuZGxlLT50eXBlID0gU0xJQ19IQU5ETEVfRlJFRTsgICAgICAgICAgICAgICAgICAgICAgICAgXAotCXNwaW5fbG9ja19pcnFzYXZlKCZfYWRhcHRlci0+aGFuZGxlX2xvY2subG9jaywgICAgICAgICAgICAgICAgICBcCi0JCQlfYWRhcHRlci0+aGFuZGxlX2xvY2suZmxhZ3MpOyAgICAgICAgICAgICAgICAgICBcCi0JX3BzbGljX2hhbmRsZS0+bmV4dCA9IF9hZGFwdGVyLT5wZnJlZV9zbGljX2hhbmRsZXM7ICAgICAgICAgICAgIFwKLQlfYWRhcHR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gKFNVQlNZU19BUFBPU19NQVggKyAxNSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTYgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTYpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzE3ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDE3KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8xOCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAxOCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMTkgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMTkpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzIwICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDIwKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yMSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyMSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjIgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjIpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzIzICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDIzKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yNCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyNCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjUgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjUpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI2ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI2KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8yNyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAyNykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMjggICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMjgpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzI5ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDI5KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zMCAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzMCkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzEgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzEpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzMyICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDMyKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zMyAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzMykKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzQgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzQpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM1ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM1KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zNiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzNikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfMzcgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgMzcpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzM4ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDM4KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV8zOSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyAzOSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDAgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDApCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQxICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQxKQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80MiAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0MikKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDMgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDMpCisjZGVmaW5lIFNVQlNZU19DT05TT0xFXzQ0ICAgICAgICAgICAoU1VCU1lTX0FQUE9TX01BWCArIDQ0KQorI2RlZmluZSBTVUJTWVNfQ09OU09MRV80NSAgICAgICAgICAgKFNVQlNZU19BUFBPU19NQVggKyA0NSkKKyNkZWZpbmUgU1VCU1lTX0NPTlNPTEVfNDYgICAgICAgICAgIChTVUJTWVNfQVBQT1NfTUFYICsgNDYpCisKK3N0YXRpYyBpbmxpbmUgY2hhciAqCitzdWJzeXNfY29uc29sZV90b19zKGludCBzdWJzeXMsIGNoYXIgKnMsIGludCBuKQoreworCXN3aXRjaCAoc3Vic3lzKSB7CisJY2FzZSBTVUJTWVNfQ09OU09MRV9WSURFTzoKKwkJc3RybmNweShzLCAiQ09OU09MRV9WSURFTyIsIG4pOworCQlicmVhazsKKwljYXNlIFNVQlNZU19DT05TT0xFX0tCRE1PVToKKwkJc3RybmNweShzLCAiQ09OU09MRV9LQkRNT1UiLCBuKTsKKwkJYnJlYWs7CisJY2FzZSBTVUJTWVNfQ09OU09MRV8wNDoKKwkJc3RybmNweShzLCAiQ09OU09MRV8wNCIsIG4pOworCQlicmVhazsKKwljYXNlIFNVQlNZU19DT05TT0xFXzA1OgorCQlzdHJuY3B5KHMsICJDT05TT0xFXzA1Iiwgbik7CisJCWJyZWFrOworCWNhc2UgU1VCU1lTX0NPTlNPTEVfMDY6CisJCXN0cm5jcHkocywgIkNPTlNPTEVfMDYiLCBuKTsKKwkJYnJlYWs7CisJY2FzZSBTVUJTWVNfQ09OU09MRV8wNzoKKwkJc3RybmNweShzLCAiQ09OU09MRV8wNyIsIG4pOworCQlicmVhazsKKwljYXNlIFNVQlNZU19DT05TT0xFXzA4OgorCQlzdHJuY3B5KHMsICJDT05TT0xFXzA4Iiwgbik7CisJCWJyZWFrOworCWNhc2UgU1VCU1lTX0NPTlNPTEVfMDk6CisJCXN0cm5jcHkocyw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KSAgICAgICAgICAgIHVwX3dyaXRlKHNlbSkKKworI2lmZGVmIEVOQUJMRV9SRVRVUk5fVFJBQ0UKKyNkZWZpbmUgUkVUVFJBQ0UoeCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlkbyB7CQkJCQkJICAgICAgIFwKKwkJaWYgKDEpIHsJCQkJICAgICAgIFwKKwkJCUlORk9EUlYoIlJFVCAweCVseCBpbiAlcyIsCSAgICAgICBcCisJCQkJKHVsb25nKSh4KSwgX19mdW5jX18pOyAgICAgXAorCQl9CQkJCQkgICBcCisJfSB3aGlsZSAoMCkKKyNlbHNlCisjZGVmaW5lIFJFVFRSQUNFKHgpCisjZW5kaWYKKworLyoqIFRyeSB0byBldmF1bGF0ZSB0aGUgcHJvdmlkZWQgZXhwcmVzc2lvbiwgYW5kIGRvIGEgUkVUSU5UKHgpIGlmZgorICogIHRoZSBleHByZXNzaW9uIGV2YWx1YXRlcyB0byA8IDAuCisgKiAgQHBhcmFtIHggdGhlIGV4cHJlc3Npb24gdG8gdHJ5CisgKi8KKyNkZWZpbmUgQVNTRVJUKGNvbmQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwlkbyB7IGlmICghKGNvbmQpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkJSFVIRFJWKCJBU1NFUlQgZmFpbGVkIC0gJXMiLAkgICAgICAgXAorCQkJICAgICAgIF9fc3RyaW5naWZ5KGNvbmQpKTsJICAgICAgIFwKKwl9IHdoaWxlICgwKQorCisjZGVmaW5lIHNpemVvZm1lbWJlcihUWVBFLCBNRU1CRVIpIChzaXplb2YoKChUWVBFICopMCktPk1FTUJFUikpCisvKiogIkNvdmVyZWQgcXVvdGllbnQiIGZ1bmN0aW9uICovCisjZGVmaW5lIENPVlEodiwgZCkgICgoKHYpICsgKGQpIC0gMSkgLyAoZCkpCisjZGVmaW5lIFNXQVBQT0lOVEVSUy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ZSBzdHJ1Y3R1cmUKKyAqLworI2RlZmluZSBERExPT0tTVkFMSUQoZGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQkoKGRkICE9IE5VTEwpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJglcCisJCSAoKGRkKS0+c2lnMSA9PSBzaXplb2YoUFJJVkFURURFVklDRURBVEEpKSAmJglcCisJCSAoKGRkKS0+c2lnMiA9PSBkZCkpCisKKy8qKiBWZXJpZmllcyB0aGUgY29uc2lzdGVuY3kgb2YgeW91ciBQUklWQVRFRklMRURBVEEgc3RydWN0dXJlIHVzaW5nCisgKiAgY29udmVudGlvbmFsICJzaWduYXR1cmUiIGZpZWxkczoKKyAqICA8cD4KKyAqICAtIHNpZzEgc2hvdWxkIGNvbnRhaW4gdGhlIHNpemUgb2YgdGhlIHN0cnVjdHVyZQorICogIC0gc2lnMiBzaG91bGQgY29udGFpbiBhIHBvaW50ZXIgdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgc3RydWN0dXJlCisgKi8KKyNkZWZpbmUgRkRMT09LU1ZBTElEKGZkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJKChmZCAhPSBOVUxMKSAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICAgICBcCisJICgoZmQpLT5zaWcxID09IHNpemVvZihQUklWQVRFRklMRURBVEEpKSAmJiAgICBcCisJICgoZmQpLT5zaWcyID09IGZkKSkKKworLyoqIExvY2tzIGRkLT5sb2NrRGV2IGlmIHlvdSBoYXZuJ3QgYWxyZWFkeSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgTE9DS0RFVihkZCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKCFsb2NrZWREZXYpIHsJCQkJICAgICAgIFwKKwkJCXNwaW5fbG9jaygmZGQtPmxvY2tEZXYpOwkJICAgICAgIFwKKwkJCWxvY2tlZERldiA9IFRSVUU7CQkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogVW5sb2NrcyBkZC0+bG9ja0RldiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLREVWKGRkKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKGxvY2tlZERldikgewkJCQkgICAgICAgXAorCQkJc3Bpbl91bmxvY2soJmRkLT5sb2NrRGV2KTsJCSAgICAgICBcCisJCQlsb2NrZWREZXYgPSBGQUxTRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBMb2NrcyBkZC0+bG9ja0RldklTUiBpZiB5b3UgaGF2bid0IGFscmVhZHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIExPQ0tERVZJU1IoZGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWlmICghbG9ja2VkRGV2SVNSKSB7CQkJCSAgICAgICBcCisJCQlzcGluX2xvY2tfaXJxc2F2ZSgmZGQtPmxvY2tEZXZJU1IsIGZsYWdzKTsgICAgIFwKKwkJCWxvY2tlZERldklTUiA9IFRSVUU7CQkJICAgICAgIFwKKwkJfQkJCQkJCSAgICAgICBcCisJfQorCisvKiogVW5sb2NrcyBkZC0+bG9ja0RldklTUiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLREVWSVNSKGRkKQkJCQkJCVwKKwl7CQkJCQkJCQlcCisJCWlmIChsb2NrZWREZXZJU1IpIHsJCQkJCVwKKwkJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmRkLT5sb2NrRGV2SVNSLCBmbGFncyk7IFwKKwkJCWxvY2tlZERldklTUiA9IEZBTFNFOwkJCQlcCisJCX0JCQkJCQkJXAorCX0KKworLyoqIExvY2tzIExvY2tHbG9iYWxJU1IgaWYgeW91IGhhdm4ndCBhbHJlYWR5IGxvY2tlZCBpdCAqLworI2RlZmluZSBMT0NLR0xPQkFMSVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAoIWxvY2tlZEdsb2JhbElTUikgewkJCQkgICAgICAgXAorCQkJc3Bpbl9sb2NrX2lycXNhdmUoJkxvY2tHbG9iYWxJU1IsIGZsYWdzKTsgICAgICBcCisJCQlsb2NrZWRHbG9iYWxJU1IgPSBUUlVFOwkJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIFVubG9ja3MgTG9ja0dsb2JhbElTUiBpZiB5b3UgcHJldmlvdXNseSBsb2NrZWQgaXQgKi8KKyNkZWZpbmUgVU5MT0NLR0xPQkFMSVNSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkJaWYgKGxvY2tlZEdsb2JhbElTUikgewkJCQkgICAgICAgXAorCQkJc3Bpbl91bmxvY2tfaXJxcmVzdG9yZSgmTG9ja0dsb2JhbElTUiwgZmxhZ3MpOyBcCisJCQlsb2NrZWRHbG9iYWxJU1IgPSBGQUxTRTsJCSAgICAgICBcCisJCX0JCQkJCQkgICAgICAgXAorCX0KKworLyoqIExvY2tzIExvY2tHbG9iYWwgaWYgeW91IGhhdm4ndCBhbHJlYWR5IGxvY2tlZCBpdCAqLworI2RlZmluZSBMT0NLR0xPQkFMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCQlpZiAoIWxvY2tlZEdsb2JhbCkgewkJCQkgICAgICAgXAorCQkJc3Bpbl9sb2NrKCZMb2NrR2xvYmFsKTsJCQkgICAgICAgXAorCQkJbG9ja2VkR2xvYmFsID0gVFJVRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBVbmxvY2tzIExvY2tHbG9iYWwgaWYgeW91IHByZXZpb3VzbHkgbG9ja2VkIGl0ICovCisjZGVmaW5lIFVOTE9DS0dMT0JBTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCWlmIChsb2NrZWRHbG9iYWwpIHsJCQkJICAgICAgIFwKKwkJCXNwaW5fdW5sb2NrKCZMb2NrR2xvYmFsKTsJCSAgICAgICBcCisJCQlsb2NrZWRHbG9iYWwgPSBGQUxTRTsJCQkgICAgICAgXAorCQl9CQkJCQkJICAgICAgIFwKKwl9CisKKy8qKiBVc2UgdGhpcyBhdCB0aGUgYmVnaW5uaW5nIG9mIGZ1bmN0aW9ucyB3aGVyZSB5b3UgaW50ZW5kIHRvCisgKiAgdXNlICNMT0NLREVWLyNVTkxPQ0tERVYsICNMT0NLREVWSVNSLyNVTkxPQ0tERVZJU1IsCisgKiAgI0xPQ0tHTE9CQUwvI1VOTE9DS0dMT0JBTCwgI0xPQ0tHTE9CQUxJU1IvI1VOTE9DS0dMT0JBTElTUi4KKyAqCisgKiAgTm90ZSB0aGF0IF9fYX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JkZXZfaW5jb21pbmciKSkgeworCQlMT0dFUlIoInVpc3RocmVhZF9zdGFydCBJbml0aWFsaXplX2luY29taW5nX3RocmVhZCAqKioqRkFJTEVEIik7CisJCXJldHVybiBGQUxTRTsKKwl9CisJSW5jb21pbmdfVGhyZWFkX1N0YXJ0ZWQgPSBUUlVFOworCXJldHVybiBUUlVFOworfQorCisvKiAgQWRkIGEgbmV3IGRldmljZS9jaGFubmVsIHRvIHRoZSBsaXN0IGJlaW5nIHByb2Nlc3NlZCBieQorICogIFByb2Nlc3NfSW5jb21pbmcoKS4KKyAqICA8aW50ZXJydXB0PiAtIGluZGljYXRlcyB0aGUgZnVuY3Rpb24gdG8gY2FsbCBwZXJpb2RpY2FsbHkuCisgKiAgPGludGVycnVwdF9jb250ZXh0PiAtIGluZGljYXRlcyB0aGUgZGF0YSB0byBwYXNzIHRvIHRoZSA8aW50ZXJydXB0PgorICogICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbi4KKyAqLwordm9pZAordWlzbGliX2VuYWJsZV9jaGFubmVsX2ludGVycnVwdHMoVTMyIGJ1c05vLCBVMzIgZGV2Tm8sCisJCQkJIGludCAoKmludGVycnVwdCkodm9pZCAqKSwKKwkJCQkgdm9pZCAqaW50ZXJydXB0X2NvbnRleHQpCit7CisJc3RydWN0IGRldmljZV9pbmZvICpkZXY7CisJZGV2ID0gZmluZF9kZXYoYnVzTm8sIGRldk5vKTsKKwlpZiAoIWRldikgeworCQlMT0dFUlIoIiVzIGJ1c05vPSVkLCBkZXZObz0lZCIsIF9fZnVuY19fLCAoaW50KSAoYnVzTm8pLAorCQkgICAgICAgKGludCkgKGRldk5vKSk7CisJCXJldHVybjsKKwl9CisJTE9DS1NFTV9VTklOVEVSUlVQVElCTEUoJkxvY2tfUG9sbGluZ19EZXZpY2VfQ2hhbm5lbHMpOworCUluaXRpYWxpemVfaW5jb21pbmdfdGhyZWFkKCk7CisJZGV2LT5pbnRlcnJ1cHQgPSBpbnRlcnJ1cHQ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ya193YWtldXBfcG9sbGluZ19kZXZpY2VfY2hhbm5lbHMpOworfQorRVhQT1JUX1NZTUJPTF9HUEwodWlzbGliX2ZvcmNlX2NoYW5uZWxfaW50ZXJydXB0KTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTW9kdWxlIEluaXQgJiBFeGl0IGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdAordWlzbGliX21vZF9pbml0KHZvaWQpCit7CisKKwlMT0dJTkYoIk1PTklUT1JBUElTIik7CisKKwlMT0dJTkYoInNpemVvZihzdHJ1Y3QgdWlzY21kcnNwKTolbHUgYnl0ZXNcbiIsCisJICAgICAgICh1bG9uZykgc2l6ZW9mKHN0cnVjdCB1aXNjbWRyc3ApKTsKKwlMT0dJTkYoInNpemVvZihzdHJ1Y3QgcGh5c19pbmZvKTolbHVcbiIsCisJICAgICAgICh1bG9uZykgc2l6ZW9mKHN0cnVjdCBwaHlzX2luZm8pKTsKKwlMT0dJTkYoInNpemVvZih1aXNjbWRyc3Bfc2NzaSk6JWx1XG4iLAorCSAgICAgICAodWxvbmcpIHNpemVvZihzdHJ1Y3QgdWlzY21kcnNwX3Njc2kpKTsKKwlMT0dJTkYoInNpemVvZih1aXNjbWRyc3BfbmV0KTolbHVcbiIsCisJICAgICAgICh1bG9uZykgc2l6ZW9mKHN0cnVjdCB1aXNjbWRyc3BfbmV0KSk7CisJTE9HSU5GKCJzaXplb2YoQ09OVFJPTFZNX01FU1NBR0UpOiVsdSBieXRlc1xuIiwKKwkgICAgICAgKHVsb25nKSBzaXplb2YoQ09OVFJPTFZNX01FU1NBR0UpKTsKKwlMT0dJTkYoInNpemVvZihVTFRSQV9DT05UUk9MVk1fQ0hBTk5FTF9QUk9UT0NPTCk6JWx1IGJ5dGVzX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Mgc2hvcnRlciB0aGFuIHVzaW5nIF9fRklMRV9fIChmdWxsIHBhdGggbmFtZSkgaW4KKyAqIGRlYnVnL2luZm8vZXJyb3IgbWVzc2FnZXMgKi8KKyNkZWZpbmUgQ1VSUkVOVF9GSUxFX1BDIFVJU0xJQl9QQ191aXNxdWV1ZV9jCisjZGVmaW5lIF9fTVlGSUxFX18gInVpc3F1ZXVlLmMiCisKKyNkZWZpbmUgQ0hFQ0tfQ0FDSEVfQUxJR04gMAorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBFeHBvcnRlZCBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBsb25nIGxvbmcKK3Vpc3F1ZXVlX0ludGVybG9ja2VkT3IodW5zaWduZWQgbG9uZyBsb25nIF9faW9tZW0gKlRhcmdldCwKKwkJICAgICAgIHVuc2lnbmVkIGxvbmcgbG9uZyBTZXQpCit7CisJdW5zaWduZWQgbG9uZyBsb25nIGk7CisJdW5zaWduZWQgbG9uZyBsb25nIGo7CisKKwlqID0gcmVhZHEoVGFyZ2V0KTsKKwlkbyB7CisJCWkgPSBqOworCQlqID0gdWlzbGliY21weGNoZzY0KChfX2ZvcmNlIHVuc2lnbmVkIGxvbmcgbG9uZyAqKVRhcmdldCwKKwkJCQkgICAgaSwgaSB8IFNldCwgc2l6ZW9mKCooVGFyZ2V0KSkpOworCisJfSB3aGlsZSAoaSAhPSBqKTsKKworCXJldHVybiBqOworfQorRVhQT1JUX1NZTUJPTF9HUEwodWlzcXVldWVfSW50ZXJsb2NrZWRPcik7CisKK3Vuc2lnbmVkIGxvbmcgbG9uZwordWlzcXVldWVfSW50ZXJsb2NrZWRBbmQodW5zaWduZWQgbG9uZyBsb25nIF9faW9tZW0gKlRhcmdldCwKKwkJCXVuc2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W5hYmxlX2ludHNfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWZmZXIsCisJCQkJIHNpemVfdCBjb3VudCwgbG9mZl90ICpwcG9zKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogR2xvYmFscyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IHJzbHRxX3dhaXRfdXNlY3MgPSA0MDAwOwkvKiBEZWZhdWx0IDRtcyAqLworc3RhdGljIHVuc2lnbmVkIGludCBNYXhCdWZmTGVuOworCisvKiBNb2R1bGUgb3B0aW9ucyAqLworc3RhdGljIGNoYXIgKnZpcnRoYmFfb3B0aW9ucyA9ICJOT05FIjsKKworc3RhdGljIGNvbnN0IHN0cnVjdCBwY2lfZGV2aWNlX2lkIHZpcnRoYmFfaWRfdGFibGVbXSA9IHsKKwl7UENJX0RFVklDRShQQ0lfVkVORE9SX0lEX1VOSVNZUywgUENJX0RFVklDRV9JRF9WSVJUSEJBKX0sCisJezB9LAorfTsKKworLyogZXhwb3J0IHZpcnRoYmFfaWRfdGFibGUgKi8KK01PRFVMRV9ERVZJQ0VfVEFCTEUocGNpLCB2aXJ0aGJhX2lkX3RhYmxlKTsKKworc3RhdGljIHN0cnVjdCB3b3JrcXVldWVfc3RydWN0ICp2aXJ0aGJhX3NlcnZlcmRvd25fd29ya3F1ZXVlOworCitzdGF0aWMgc3RydWN0IHZpcnRwY2lfZHJpdmVyIHZpcnRoYmFfZHJpdmVyID0geworCS5uYW1lID0gInVpc3ZpcnRoYmEiLAorCS52ZXJzaW9uID0gVkVSU0lPTiwKKwkudmVydGFnID0gTlVMTCwKKwkuYnVpbGRfZGF0ZSA9IF9fREFURV9fLAorCS5idWlsZF90aW1lID0gX19USU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qKioqKioqKioqKioqKioqKioqKi8KKy8qIERBUldvcmtRIEhhbmRsZXIgVGhyZWFkICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkCitkb0Rpc2tBZGRSZW1vdmUoc3RydWN0IHdvcmtfc3RydWN0ICp3b3JrKQoreworCXN0cnVjdCBkaXNrYWRkcmVtb3ZlICpkYXI7CisJc3RydWN0IGRpc2thZGRyZW1vdmUgKnRtcGhlYWQ7CisJaW50IGkgPSAwOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisKKwlzcGluX2xvY2tfaXJxc2F2ZSgmREFSV29ya1FMb2NrLCBmbGFncyk7CisJdG1waGVhZCA9IERBUldvcmtRSGVhZDsKKwlEQVJXb3JrUUhlYWQgPSBOVUxMOworCURBUldvcmtRU2NoZWQgPSAwOworCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJkRBUldvcmtRTG9jaywgZmxhZ3MpOworCXdoaWxlICh0bXBoZWFkKSB7CisJCWRhciA9IHRtcGhlYWQ7CisJCXRtcGhlYWQgPSBkYXItPm5leHQ7CisJCVNlbmREaXNrQWRkUmVtb3ZlKGRhcik7CisJCWkrKzsKKwl9Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFJvdXRpbmUgdG8gYWRkIGVudHJ5IHRvIERBUldvcmtRICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3N0YXRpYyB2b2lkCitwcm9jZXNzX2Rpc2tfbm90aWZ5KHN0cnVjdCBTY3NpX0hvc3QgKnNob3N0LCBzdHJ1Y3QgdWlzY21kcnNwICpjbWRyc3ApCit7CisJc3RydWN0IGRpc2thZGRyZW1vdmUgKmRhcjsKKwl1bnNp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kaXNrLT5uZXh0OworCQkJdmRpc2stPm5leHQgPSB2ZGlzay0+bmV4dC0+bmV4dDsKKwkJCWtmcmVlKGRlbHZkaXNrKTsKKwkJCXJldHVybjsKKwkJfQorCX0KKwlyZXR1cm47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIFNjc2kgQ21uZCBzdXBwb3J0IHRocmVhZCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIHZvaWQKK2RvX3Njc2lfbGludXhzdGF0KHN0cnVjdCB1aXNjbWRyc3AgKmNtZHJzcCwgc3RydWN0IHNjc2lfY21uZCAqc2NzaWNtZCkKK3sKKwlzdHJ1Y3QgdmlydGRpc2tfaW5mbyAqdmRpc2s7CisJc3RydWN0IHNjc2lfZGV2aWNlICpzY3NpZGV2OworCXN0cnVjdCBzZW5zZV9kYXRhICpzZDsKKworCXNjc2lkZXYgPSBzY3NpY21kLT5kZXZpY2U7CisJbWVtY3B5KHNjc2ljbWQtPnNlbnNlX2J1ZmZlciwgY21kcnNwLT5zY3NpLnNlbnNlYnVmLCBNQVhfU0VOU0VfU0laRSk7CisJc2QgPSAoc3RydWN0IHNlbnNlX2RhdGEgKikgc2NzaWNtZC0+c2Vuc2VfYnVmZmVyOworCisJLyogRG8gbm90IGxvZyBlcnJvcnMgZm9yIGRpc2stbm90LXByZXNlbnQgaW5xdWlyaWVzICovCisJaWYgKChjbWRyc3AtPnNjc2kuY21uZFswXSA9PSBJTlFVSVJZKSAmJgorCSAgICAoaG9zdF9ieXRlKGNtZHJzcC0+c2NzaS5saW51eHN0YXQpID09IERJRF9OT19DT05ORUNUKSAmJgorCSAgICAoY21kcnNwLT5zY3NpLmFkZGxzdGF0ID09IEFERExfU0VMX1RJTUVPVVQpKQorCQlyZXR1cm47CisKKwkvKiBPa2F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igiZXhpdGluZyBwcm9jZXNzaW5nIGluY29taW5nIHJzcHMuXG4iKTsKKwljb21wbGV0ZV9hbmRfZXhpdCgmZGMtPnRocmVhZGluZm8uaGFzX3N0b3BwZWQsIDApOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBwcm9jIGZpbGVzeXN0ZW0gZnVuY3Rpb25zCQkJCQkJICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBzc2l6ZV90CitpbmZvX3Byb2NfcmVhZChzdHJ1Y3QgZmlsZSAqZmlsZSwgY2hhciBfX3VzZXIgKmJ1Ziwgc2l6ZV90IGxlbiwgbG9mZl90ICpvZmZzZXQpCit7CisJaW50IGxlbmd0aCA9IDA7CisJVTY0IHBoeXNfZmxhZ3NfYWRkcjsKKwlpbnQgaTsKKwlzdHJ1Y3QgdmlydGhiYV9pbmZvICp2aXJ0aGJhaW5mbzsKKwljaGFyICp2YnVmOworCWxvZmZfdCBwb3MgPSAqb2Zmc2V0OworCisJaWYgKHBvcyA8IDApCisJCXJldHVybiAtRUlOVkFMOworCisJaWYgKHBvcyA+IDAgfHwgIWxlbikKKwkJcmV0dXJuIDA7CisKKwl2YnVmID0ga3phbGxvYyhsZW4sIEdGUF9LRVJORUwpOworCWlmICghdmJ1ZikKKwkJcmV0dXJuIC1FTk9NRU07CisKKwlmb3IgKGkgPSAwOyBpIDwgVklSVEhCQVNPUEVOTUFYOyBpKyspIHsKKwkJaWYgKFZpcnRIYmFzT3BlbltpXS52aXJ0aGJhaW5mbyA9PSBOVUxMKQorCQkJY29udGludWU7CisKKwkJdmlydGhiYWluZm8gPSBWaXJ0SGJhc09wZW5baV0udmlydGhiYWluZm87CisJCWxlbmd0aCArPSBzcHJpbnRmKHZidWYgKyBsZW5ndGgsICJDSEFOU09DSyBpcyBub3QgZGVmaW5lZC5cbiIpOworCisJCWxl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gICZ2aXJ0aGJhaW5mby0+c2VydmVyZG93bl9jb21wbGV0aW9uKTsKKwl9IGVsc2UgaWYgKHZpcnRoYmFpbmZvLT5zZXJ2ZXJjaGFuZ2luZ3N0YXRlKSB7CisJCUxPR0VSUigiU2VydmVyIGFscmVhZHkgcHJvY2Vzc2luZyBjaGFuZ2Ugc3RhdGUgbWVzc2FnZVxuIik7CisJCXJldHVybiAwOworCX0gZWxzZQorCQlMT0dFUlIoIlNlcnZlciBhbHJlYWR5IGRvd24sIGJ1dCBhbm90aGVyIHNlcnZlciBkb3duIG1lc3NhZ2UgcmVjZWl2ZWQuIik7CisKKwlyZXR1cm4gMTsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyogTW9kdWxlIEluaXQgJiBFeGl0IGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgaW50IF9faW5pdAordmlydGhiYV9wYXJzZV9saW5lKGNoYXIgKnN0cikKK3sKKwlEQkdJTkYoIkluIHZpcnRoYmFfcGFyc2VfbGluZSAlc1xuIiwgc3RyKTsKKwlyZXR1cm4gMTsKK30KKworc3RhdGljIHZvaWQgX19pbml0Cit2aXJ0aGJhX3BhcnNlX29wdGlvbnMoY2hhciAqbGluZSkKK3sKKwljaGFyICpuZXh0ID0gbGluZTsKKworCVBPU1RDT0RFX0xJTlVYXzIoVkhCQV9DUkVBVEVfRU5UUllfUEMsIFBPU1RDT0RFX1NFVkVSSVRZX0lORk8pOworCWlmIChsaW5lID09IE5VTEwgfHwgISpsaW5lKQorCQlyZXR1cm47CisJd2hpbGUgKChsaW5lID0gbmV4dCkgIT0gTlVMTCkgeworCQluZXh0ID0gc3RyY2hyKGxpbmUsICcgJyk7CisJCWlmIChuZXh0ICE9IE5VTEwpCisJCQkqbmV4dCsrID0gMDsKKwk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U0laRSAyMAorI2VuZGlmCisKKyNkZWZpbmUgQlVTX0lEKHgpIGRldl9uYW1lKHgpCisKKyNpbmNsdWRlICJ2aXJ0cGNpLmgiCisKKy8qIHRoaXMgaXMgc2hvcnRlciB0aGFuIHVzaW5nIF9fRklMRV9fIChmdWxsIHBhdGggbmFtZSkgaW4KKyAqIGRlYnVnL2luZm8vZXJyb3IgbWVzc2FnZXMKKyAqLworI2RlZmluZSBDVVJSRU5UX0ZJTEVfUEMgVklSVF9QQ0lfUENfdmlydHBjaV9jCisjZGVmaW5lIF9fTVlGSUxFX18gInZpcnRwY2kuYyIKKworI2RlZmluZSBWSVJUUENJX1ZFUlNJT04gIjAxLjAwIgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBGb3J3YXJkIGRlY2xhcmF0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgZGVsZXRlX3ZidXNfZGV2aWNlKHN0cnVjdCBkZXZpY2UgKnZidXMsIHZvaWQgKmRhdGEpOworc3RhdGljIGludCBtYXRjaF9idXNpZChzdHJ1Y3QgZGV2aWNlICpkZXYsIHZvaWQgKmRhdGEpOworc3RhdGljIHZvaWQgdmlydHBjaV9idXNfcmVsZWFzZShzdHJ1Y3QgZGV2aWNlICpkZXYpOworc3RhdGljIHZvaWQgdmlydHBjaV9kZXZpY2VfcmVsZWFzZShzdHJ1Y3QgZGV2aWNlICpkZXYpOworc3RhdGljIGludCB2aXJ0cGNpX2RldmljZV9hZGQoc3RydWN0IGRldmljZSAqcGFyZW50YnVzLCBpbnQgZGV2dHlwZSwKKwkJCSAgICAgIHN0cnVjdCBhZGRfdmlydF9ndWVzdHBhcnQgKmFkZHBhcmFtcywKKwkJCSAgICAgIHN0cnVjdCBzY3NpX2FkYXBfaW5mbyAqc2N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2aWNlICpkZXYsIHN0cnVjdCBrb2JqX3VldmVudF9lbnYgKmVudik7CitzdGF0aWMgaW50IHZpcnRwY2lfZGV2aWNlX3N1c3BlbmQoc3RydWN0IGRldmljZSAqZGV2LCBwbV9tZXNzYWdlX3Qgc3RhdGUpOworc3RhdGljIGludCB2aXJ0cGNpX2RldmljZV9yZXN1bWUoc3RydWN0IGRldmljZSAqZGV2KTsKK3N0YXRpYyBpbnQgdmlydHBjaV9kZXZpY2VfcHJvYmUoc3RydWN0IGRldmljZSAqZGV2KTsKK3N0YXRpYyBpbnQgdmlydHBjaV9kZXZpY2VfcmVtb3ZlKHN0cnVjdCBkZXZpY2UgKmRldik7CitzdGF0aWMgc3NpemVfdCB2aXJ0X3Byb2Nfd3JpdGUoc3RydWN0IGZpbGUgKmZpbGUsIGNvbnN0IGNoYXIgX191c2VyICpidWZmZXIsCisJCQkgICAgICAgc2l6ZV90IGNvdW50LCBsb2ZmX3QgKnBwb3MpOworc3RhdGljIHNzaXplX3QgaW5mb19wcm9jX3JlYWQoc3RydWN0IGZpbGUgKmZpbGUsIGNoYXIgX191c2VyICpidWYsCisJCQkgICAgICBzaXplX3QgbGVuLCBsb2ZmX3QgKm9mZnNldCk7CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIHByb2NfdmlydF9mb3BzID0geworCS53cml0ZSA9IHZpcnRfcHJvY193cml0ZSwKK307CisKK3N0YXRpYyBjb25zdCBzdHJ1Y3QgZmlsZV9vcGVyYXRpb25zIHByb2NfaW5mb19mb3BzID0geworCS5yZWFkID0gaW5mb19wcm9jX3JlYWQsCit9OworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBHbG9iYWxzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qI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GV2aWNlIHZpcnRwY2lfYnVzX2RldmljZTsKK307CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIExvY2FsIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGlubGluZQoraW50IFdBSVRfRk9SX0lPX0NIQU5ORUwoVUxUUkFfSU9fQ0hBTk5FTF9QUk9UT0NPTCBfX2lvbWVtICAqY2hhbnB0cikKK3sKKwlpbnQgY291bnQgPSAxMjA7CisJd2hpbGUgKGNvdW50ID4gMCkgeworCisJCWlmIChVTFRSQV9DSEFOTkVMX1NFUlZFUl9SRUFEWSgmY2hhbnB0ci0+Q2hhbm5lbEhlYWRlcikpCisJCQlyZXR1cm4gMTsKKwkJVUlTX1RIUkVBRF9XQUlUX1NFQygxKTsKKwkJY291bnQtLTsKKwl9CisJcmV0dXJuIDA7Cit9CisKKy8qIFdyaXRlIHRoZSBjb250ZW50cyBvZiA8aW5mbz4gdG8gdGhlIFVMVFJBX1ZCVVNfQ0hBTk5FTF9QUk9UT0NPTC5DaHBJbmZvLiAqLworc3RhdGljIGludCB3cml0ZV92YnVzX2NocEluZm8oVUxUUkFfVkJVU19DSEFOTkVMX1BST1RPQ09MICpjaGFuLAorCQkJICAgICAgVUxUUkFfVkJVU19ERVZJQ0VJTkZPICppbmZvKQoreworCWludCBvZmY7CisJaWYgKCFjaGFuKSB7CisJCUxPR0VSUigidmJ1cyBjaGFubmVsIG5vdCBwcmVzZW50Iik7CisJCXJldHVybiAtMTsKKwl9CisJb2ZmID0gc2l6ZW9mKFVMVFJBX0NIQU5ORUxfUFJPVE9DT0wpICsgY2hhbi0+SGRySW5mby5jaHBJbmZvQnl0ZU9mZnNldDsKKwlpZiAoY2hhbi0+SGRySW5mby5jaHBJbmZvQnl0ZU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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitzdGF0aWMgdm9pZCB2aXJ0cGNpX2J1c19yZWxlYXNlKHN0cnVjdCBkZXZpY2UgKmRldikKK3sKKwkvKiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCB3aGVuIHRoZSBsYXN0IHJlZmVyZW5jZSB0byB0aGUKKwkgKiBkZXZpY2UgaXMgcmVtb3ZlZAorCSAqLworCURCR0lORigiSW4gdmlydHBjaV9idXNfcmVsZWFzZVxuIik7CisJLyogd2hhdCBlbHNlIGlzIHN1cHBvc2VkIHRvIGhhcHBlbiBoZXJlPyAqLworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBBZGFwdGVyIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyBpbnQgdmlydHBjaV9kZXZpY2VfYWRkKHN0cnVjdCBkZXZpY2UgKnBhcmVudGJ1cywgaW50IGRldnR5cGUsCisJCQkgICAgICBzdHJ1Y3QgYWRkX3ZpcnRfZ3Vlc3RwYXJ0ICphZGRwYXJhbXMsCisJCQkgICAgICBzdHJ1Y3Qgc2NzaV9hZGFwX2luZm8gKnNjc2ksIC8qIE5VTEwgZm9yIFZOSUMgYWRkICovCisJCQkgICAgICBzdHJ1Y3QgbmV0X2FkYXBfaW5mbyAqbmV0CS8qIE5VTEwgZm9yIFZIQkEgYWRkICovKQoreworCXN0cnVjdCB2aXJ0cGNpX2RldiAqdmlydHBjaWRldiA9IE5VTEw7CisJc3RydWN0IHZpcnRwY2lfZGV2ICp0bXB2cGNpZGV2ID0gTlVMTCwgKnByZXY7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlpbnQgcmV0OworCVVMVFJBX0lPX0NIQU5ORUxfUFJPVE9DT0wgX19p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W1zLmNoYW5wdHIgPQorCQkgICAgKHZvaWQgKikgaW9yZW1hcF9jYWNoZShzdG9yYWdlY2hhbm5lbCwgSU9fQ0hBTk5FTF9TSVpFKTsKKwkJaWYgKGFkZHBhcmFtcy5jaGFucHRyID09IE5VTEwpIHsKKwkJCUxPR0VSUigiRmFpbHVyZSB0byBnZXQgcmVtYXAgc3RvcmFnZSBjaGFubmVsLlxuIik7CisJCQlyZXR1cm4gLUVGQVVMVDsKKwkJfQorCQlhZGRwYXJhbXMuYnVzTm8gPSBidXNubzsKKwkJYWRkcGFyYW1zLmRldmljZU5vID0gZGV2aWNlbm87CisJCWlmICh0eXBlID09IFZJUlRIQkFfVFlQRSkgeworCQkJaWYgKGFkZF92aGJhKCZhZGRwYXJhbXMpKQorCQkJCXJldHVybiBjb3VudDsJLyogc3VjY2VzcyAqLworCQl9CisJCXJldHVybiAtRUZBVUxUOworI2VuZGlmCisJY2FzZSAweGY6CisJCS8qIGRlbGV0ZSBhbGwgdmhiYXMvdm5pY3MgKi8KKwkJaSA9IHNzY2FuZihidWYsICIleC0leC0lZCIsICZ0eXBlLCAmYWN0aW9uLCAmYnVzbm8pOworCQlpZiAoaSAhPSAzKQorCQkJYnJlYWs7CisJCWJ1c2RlbHBhcmFtcy5idXNObyA9IGJ1c25vOworCQlkZWxldGVfYWxsX3ZpcnQodHlwZSwgJmJ1c2RlbHBhcmFtcyk7CisJCXJldHVybiBjb3VudDsJLyogc3VjY2VzcyAqLworCWRlZmF1bHQ6CisJCWJyZWFrOworCX0KKwlQUklOVF9VU0FHRV9SRVRVUk47Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qIE1vZHVsZSBJbml0ICYgRXhpdCBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworc3RhdGljIGludCBfX2lu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XRpb249PTAuCisgKgorICogICBtc2dIZHIgICAgICB0aGUgY29udHJvbHZtIG1lc3NhZ2UgaGVhZGVyIG9mIHRoZSBHRVRGSUxFIHJlcXVlc3Qgd2hpY2gKKyAqICAgICAgICAgICAgICAgd2UganVzdCByZWNlaXZlZAorICogICBmaWxlX3JlcXVlc3RfbnVtYmVyICB0aGlzIGlzIGFsbCBkYXRhIGZyb20gdGhlIEdFVEZJTEUgcmVxdWVzdCB0aGF0CisgKiAgIHVwbGlua19pbmRleCAgICAgICAgIGRlZmluZSB3aGljaCBmaWxlIGlzIHRvIGJlIHRyYW5zZmVycmVkCisgKiAgIGRpc2tfaW5kZXgKKyAqICAgZmlsZV9uYW1lCisgKiAgIGdldF9jb250aWd1b3VzX2NvbnRyb2x2bV9wYXlsb2FkICBmdW5jdGlvbiB0byBjYWxsIHdoZW4gc3BhY2UgaXMgbmVlZGVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgcGF5bG9hZCBhcmVhCisgKiAgIGNvbnRyb2x2bV9yZXNwb25kX3dpdGhfcGF5bG9hZCAgICBmdW5jdGlvbiB0byBjYWxsIHRvIHNlbmQgZWFjaCBjb250cm9sdm0KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlIGNvbnRhaW5pbmcgZmlsZSBkYXRhIGFzIHRoZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF5bG9hZDsgcmV0dXJucyBGQUxTRSBvbmx5IGlmIHRoZQorICoJCQkJICAgICAgIHBheWxvYWQgYnVmZmVyIHdhcyBmcmVlZCBpbmxpbmUKKyAqICAgZHVtcF9mdW5jICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRvIGR1bXAgY29udGV4dCBkYXRhIGluCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBodW1hbi1yZWFkYWJsZSBmb3JtYXQKKyAqCisgKiA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lZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9kaWZ5CisgKiBpdCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZCBieQorICogdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbjsgZWl0aGVyIHZlcnNpb24gMiBvZiB0aGUgTGljZW5zZSwgb3IgKGF0CisgKiB5b3VyIG9wdGlvbikgYW55IGxhdGVyIHZlcnNpb24uCisgKgorICogVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsIGJ1dAorICogV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhvdXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgorICogTUVSQ0hBTlRBQklMSVRZIE9SIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLCBHT09EIFRJVExFIG9yCisgKiBOT04gSU5GUklOR0VNRU5ULiAgU2VlIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZQorICogZGV0YWlscy4KKyAqLworCisvKiogQGZpbGUgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogIFRoaXMgZGVzY3JpYmVzIHN0cnVjdHVyZXMgbmVlZGVkIGZvciB0aGUgaW50ZXJmYWNlIGJldHdlZW4gdGhlCisgKiAgdmlzb3JjaGlwc2V0IGRyaXZlciBhbmQgYSB1c2VyLW1vZGUgY29tcG9uZW50IHRoYXQgb3BlbnMgdGhlIGRldmljZS4KKyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KKworI2lmbmRlZiBfX1ZJU09SQ0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wpOworCisJCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJnByaXYtPmxvY2ssIGZsYWdzKTsKKwl9Cit9CisKK3ZvaWQgdm50X2NvbmZpZ3VyZV9maWx0ZXIoc3RydWN0IHZudF9wcml2YXRlICpwcml2KQoreworCXN0cnVjdCBuZXRfZGV2aWNlICpkZXYgPSBwcml2LT5kZXY7CisJc3RydWN0IHZudF9tYW5hZ2VyICptZ210ID0gJnByaXYtPnZudF9tZ210OwogCXN0cnVjdCBuZXRkZXZfaHdfYWRkciAqaGE7Ci0JdTMyIG1jX2ZpbHRlclsyXTsKLQlpbnQgaWk7Ci0JdTggcGJ5RGF0YVs4XSA9IHsweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmLCAweGZmfTsKLQl1OCBieVRtcE1vZGUgPSAwOworCXU2NCBtY19maWx0ZXIgPSAwOworCXU4IHRtcCA9IDA7CiAJaW50IHJjOwogCi0Jc3Bpbl9sb2NrX2lycSgmcERldmljZS0+bG9jayk7Ci0gICAgcmMgPSBDT05UUk9MbnNSZXF1ZXN0SW4ocERldmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1RZUEVfUkVBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHX1JDUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNRVNTQUdFX1JFUVVFU1RfTUFDUkVHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJmJ5VG1wTW9kZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgaWYgKHJjID09IDApIHBEZXZpY2UtPmJ5UnhNb2RlID0gYnlUbXBNb2RlOworCXJjID0gQ09OVFJPTG5zUmVxdWVzdEluKHByaXYsIE1FU1NBR0VfVFlQRV9SRUFELAorCQlNQUNfUkVHX1JDUiwgTUVTU0FHRV9SRVFVRVNUX01BQ1JFRywgMSwgJnRtcCk7CisJaWYgKHJjID09IDApCisJCXByaXYtPmJ5UnhNb2RlID0gdG1wOwogCi0gICAgREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAicERldmljZS0+YnlSeE1vZGUgaW49ICV4XG4iLCBwRGV2aWNlLT5ieVJ4TW9kZSk7CisJREJHX1BSVChNU0dfTEVWRUxfREVCVUcsIEtFUk5fSU5GTyAicHJpdi0+YnlSeE1vZGUgaW49ICV4XG4iLAorCQkJCQkJCXByaXYtPmJ5UnhNb2RlKTsKIAotICAgIGlmIChkZXYtPmZsYWdzICYgSUZGX1BST01JU0MpIHsgLyogc2V0IHByb21pc2N1b3VzIG1vZGUgKi8KLSAgICAgICAgREJHX1BSVChNU0dfTEVWRUxfRVJSLEtFUk5fTk9USUNFICIlczogUHJvbWlzY3VvdXMgbW9kZSBlbmFibGVkLlxuIiwgZGV2LT5uYW1lKTsKLQkvKiB1bmNvbmRpdGlvbmFsbHkgbG9nIG5ldCB0YXBzICovCi0gICAgICAgIHBEZXZpY2UtPmJ5UnhNb2RlIHw9IChSQ1JfTVVMVElDQVNUfFJDUl9CUk9BRENBU1R8UkNSX1VOSUNBU1QpOwotICAgIH0KLSAgICBlbHNlIGlmICgobmV0ZGV2X21jX2NvdW50KGRldikgPiBwRGV2aWNlLT5tdWx0aWNhc3RfbGltaXQpIHx8Ci0JICAgICAoZGV2LT5mbGFncyAmIElGRl9BTExNVUxUSSkpIHsKLSAgICAgICAgQ09OVFJPTG5zUmVxdWVzdE91dChwRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1FU1NBR0VfVFlQRV9XUklURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNQUNfUkVHX01BUjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTUVTU0FHRV9SRVFVRVNUX01BQ1JFRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICA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pY2UtPnVsQ2hlY2tGb3JIYW5nQ291bnQgPSAwOwotLy8gICAgcERldmljZS0+cFBlbmRpbmdCdWxrT3V0Q29udGV4dCA9IE5VTEw7CisJY29udGV4dC0+YkJvb2xJblVzZSA9IGZhbHNlOwogCi0gICAgaWYgKCBDT05URVhUX0RBVEFfUEFDS0VUID09IENvbnRleHRUeXBlICkgewotICAgICAgICAvLyBJbmRpY2F0ZSB0byB0aGUgcHJvdG9jb2wgdGhlIHN0YXR1cyBvZiB0aGUgc2VudCBwYWNrZXQgYW5kIHJldHVybgotICAgICAgICAvLyBvd25lcnNoaXAgb2YgdGhlIHBhY2tldC4KLQkgICAgaWYgKHBDb250ZXh0LT5wUGFja2V0ICE9IE5VTEwpIHsKLQkgICAgICAgIGRldl9rZnJlZV9za2JfaXJxKHBDb250ZXh0LT5wUGFja2V0KTsKLQkgICAgICAgIHBDb250ZXh0LT5wUGFja2V0ID0gTlVMTDsKLSAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8idHggICVkIGJ5dGVzXG4iLChpbnQpdWxCdWZMZW4pOwotCSAgICB9Ci0KLSAgICAgICAgcERldmljZS0+ZGV2LT50cmFuc19zdGFydCA9IGppZmZpZXM7Ci0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBTVEFUVVNfU1VDQ0VTUykgewotICAgICAgICAgICAgcERldmljZS0+cGFja2V0c1NlbnQrKzsKLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIERCR19QUlQoTVNHX0xFVkVMX0RFQlVHLCBLRVJOX0lORk8iU2VuZCBVU0IgZXJyb3IhIFslMDh4aF1cbiIsIHN0YXR1cyk7Ci0gICAgICAgICAgICBwRGV2aWNlLT5wYWNrZXRzU2VudERyb3BwZWQrKzsKLSAgICAgICAgfQotCi0gICAgfQotICAgIGlmIChwRGV2aWNlLT5iTGlua1Bhc3MgPT0gdHJ1ZSkgewotICAgICAgICBpZiAobmV0aWZ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ZSBWQUxJRF9QQVJBTShDKSBcCiAJeyBcCi0JCWlmICghKEMpKSBcCi0JCXsgXAorCQlpZiAoIShDKSkgeyBcCiAJCQlwcmludGsoS0VSTl9JTkZPICJXaXJlbGVzcywgcGFyYW1ldGVyIGVycm9yOiBcIiVzXCJcbiIsICNDKTsgXAogCQkJZ290byBmYWlsZWQ7IFwKIAkJfSBcCkBAIC0xNDIsNyArMTI2LDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKglsb2NhbCBmdW5jdGlvbnMKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2lzcl9oYW5kbGVyKCB1bnNpZ25lZCBsb25nIHAgKTsKK3ZvaWQgd2xfaXNyX2hhbmRsZXIodW5zaWduZWQgbG9uZyBwKTsKIAogI2lmIDAgLy9TQ1VMTF9VU0VfUFJPQyAvKiBkb24ndCB3YXN0ZSBzcGFjZSBpZiB1bnVzZWQgKi8KIHN0YXRpYyBpbnQgc2N1bGxfcmVhZF9wcm9jbWVtKHN0cnVjdCBzZXFfZmlsZSAqbSwgdm9pZCAqdik7CkBAIC0xNjgsNyArMTUyLDcgQEAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBtb2R1bGUgcGFyYW1ldGVyIGRlZmluaXRpb25zIC0gc2V0IHdpdGggJ2luc21vZCcKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgcF91MTYgICAgaXJxX21hc2sgICAgICAgICAgICAgICAgPSAweGRlYjg7IC8vIElSUTMsNCw1LDcsOSwxMCwxMSwx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BIQ0ZfRU5DQVAKICNkZWZpbmUgTVRVX01BWCAoSENGX01BWF9NU0cgLSBFVEhfSExFTiAtIDgpCkBAIC0xMjEsMTcgKzEwMywxNSBAQAogI2RlZmluZSBNVFVfTUFYIChIQ0ZfTUFYX01TRyAtIEVUSF9ITEVOKQogI2VuZGlmCiAKLS8vc3RhdGljIGludCBtdHUgPSBNVFVfTUFYOwotLy9NT0RVTEVfUEFSTShtdHUsICJpIik7Ci0vL01PRFVMRV9QQVJNX0RFU0MobXR1LCAiTVRVIik7Ci0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKiBtYWNyb3MKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAjZGVmaW5lIEJMT0NLX0lOUFVUKGJ1ZiwgbGVuKSBcCi0gICAgZGVzYy0+YnVmX2FkZHIgPSBidWY7IFwKLSAgICBkZXNjLT5CVUZfU0laRSA9IGxlbjsgXAotICAgIHN0YXR1cyA9IGhjZl9yY3ZfbXNnKCYobHAtPmhjZkN0eCksIGRlc2MsIDApCisJZG8geyBcCisJCWRlc2MtPmJ1Zl9hZGRyID0gYnVmOyBcCisJCWRlc2MtPkJVRl9TSVpFID0gbGVuOyBcCisJCXN0YXR1cyA9IGhjZl9yY3ZfbXNnKCYobHAtPmhjZkN0eCksIGRlc2MsIDApOyBcCisJfSB3aGlsZSAoMCkKIAogI2RlZmluZSBCTE9DS19JTlBVVF9ETUEoYnVmLCBsZW4pIG1lbWNweSggYnVmLCBkZXNjX25leHQtPmJ1Zl9hZGRyLCBwa3RsZW4gKQogCkBAIC0xNTgsMjAgKzEzOCwxMiBAQAogICogICAgICBlcnJubyB2YWx1ZSBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX2luaXQoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX2luaXQoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLS8vICAgIHVuc2lnbmVkIGxvbmcgICAgICAgZmxhZ3M7Ci0vLyAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgICpscCA9IHdsX3ByaXYoZGV2KTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7CisJcmV0dXJuIDA7Cit9CQkJCS8qIHdsX2luaXQgKi8KIAotICAgIERCR19QQVJBTSggRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldiApOwotCi0gICAgLyogTm90aGluZyB0byBkbywgYnV0IGdyYWIgdGhlIHNwaW5sb2NrIGFueXdheSBqdXN0IGluIGNhc2Ugd2UgZXZlciBuZWVkCi0gICAgICAgdGhpcyByb3V0aW5lICovCi0vLyAgd2xfbG9jayggbHAsICZmbGFncyApOwotLy8gIHdsX3VubG9jayggbHAsICZmbGFncyApOwotCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2luaXQKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xOTMsMTcgKzE2NSwyMCBAQAogICogICAgICBlcnJubyBvdGhlcndpc2UKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX2NvbmZpZyggc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmbWFwICptYXAgKQoraW50IHdsX2NvbmZpZyhzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3QgaWZtYXAgKm1hcCkKIHsKLSAgICBEQkdfUEFSQU0oIERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYgKTsKLSAgICBEQkdfUEFSQU0oIERiZ0luZm8sICJtYXAiLCAiMHglcCIsIG1hcCApOworCURCR19QQVJBTShEYmdJbmZvLCAiZGV2IiwgIiVzICgweCVwKSIsIGRldi0+bmFtZSwgZGV2KTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgIm1hcCIsICIweCVwIiwgbWFwKTsKIAotICAgIC8qIFRoZSBvbmx5IHRoaW5nIHdlIGNhcmUgYWJvdXQgaGVyZSBpcyBhIHBvcnQgY2hhbmdlLiBTaW5jZSB0aGlzIG5vdCBuZWVkZWQsCi0gICAgICAgaWdub3JlIHRoZSByZXF1ZXN0LiAqLwotICAgIERCR19UUkFDRShEYmdJbmZvLCAiJXM6ICVzIGNhbGxlZC5cbiIsIGRldi0+bmFtZSwgX19mdW5jX18pOworCS8qCisJICogVGhlIG9ubHkgdGhpbmcgd2UgY2FyZSBhYm91dCBoZXJlIGlzIGEgcG9ydCBjaGFuZ2UuCisJICogU2luY2UgdGhpcyBub3QgbmVlZGVkLCBpZ25vcmUgdGhlIHJlcXVlc3QuIAorCSAqLworCURCR19UUkFDRShEYmdJbmZvLCAiJXM6ICVzIGNhbGxlZC5cbiIsIGRldi0+bmFtZSwgX19mdW5jX18pOwogCi0gICAgcmV0dXJuIDA7Ci19IC8vIHdsX2NvbmZpZworCXJldHVybiAwOworfQkJCQkvKiB3bF9jb25maWcgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTIyNCw0OCArMTk5LDQ3IEBACiAgKiAgICAgIHN0YXRpc3RpY3MuCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICp3bF9zdGF0cyggc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitzdHJ1Y3QgbmV0X2RldmljZV9zdGF0cyAqd2xfc3RhdHMoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50OwotI2VuZGlmICAvKiBVU0VfV0RTICovCi0gICAgdW5zaWduZWQgbG9uZyAgICAgICAgICAgICAgIGZsYWdzOwotICAgIHN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICAgICAqcFN0YXRzOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICAgICAqbHAgPSB3bF9wcml2KGRldik7CisJaW50IGNvdW50OworI2VuZGlmIC8qIFVTRV9XRFMgKi8KKwl1bnNpZ25lZCBsb25nIGZsYWdzOworCXN0cnVjdCBuZXRfZGV2aWNlX3N0YXRzICpwU3RhdHM7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOwogCi0gICAgLy9EQkdfUEFSQU0oIERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYgKTsKKwkvKkRCR19QQVJBTSggRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldiApOyAqLwogCi0gICAgcFN0YXRzID0gTlVMTDsKKwlwU3RhdHMgPSBOVUxMOwogCi0gICAgd2xfbG9jayggbHAsICZmbGFncyApOworCXdsX2xvY2sobHAsICZmbGFncyk7CiAKICNpZmRl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yBzdGlsbCBOVUxMLCB0aGVuIHRoZSBkZXZpY2UgaXMgbm90IGEgV0RTIHBvcnQgKi8KKwlpZiAocFN0YXRzID09IE5VTEwpCisJCXBTdGF0cyA9ICYobHAtPnN0YXRzKTsKIAotICAgIHdsX3VubG9jayggbHAsICZmbGFncyApOworCXdsX3VubG9jayhscCwgJmZsYWdzKTsKIAotICAgIHJldHVybiBwU3RhdHM7Ci19IC8vIHdsX3N0YXRzCisJcmV0dXJuIHBTdGF0czsKK30JCQkJLyogd2xfc3RhdHMgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTI4OCw3NSArMjYyLDc3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50IHdsX29wZW4oc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBpbnQgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEhDRl9TVUNDRVNTOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgKmxwID0gd2xfcHJpdihkZXYpOwotICAgIHVuc2lnbmVkIGxvbmcgICAgICAgZmxhZ3M7CisJaW50IHN0YXR1cyA9IEhDRl9TVUNDRVNTOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOwogCi0gICAgd2xfbG9jayggbHAsICZmbGFncyApOworCXdsX2xvY2sobHAsICZmbGFncyk7CiAKICNpZmRlZiBVU0VfUlRTCi0gICAgaWYoIGxwLT51c2VSVFMgPT0gMSApIHsKLQlEQkdfVFJBQ0UoIERiZ0luZm8sICJTa2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9pbnRfb24oIGxwICk7CisJCS8qIFN0YXJ0IGhhbmRsaW5nIGludGVycnVwdHMgKi8KKwkJbHAtPmlzX2hhbmRsaW5nX2ludCA9IFdMX0hBTkRMSU5HX0lOVDsKKwkJd2xfYWN0X2ludF9vbihscCk7CiAKLQluZXRpZl9zdGFydF9xdWV1ZSggZGV2ICk7Ci0JV0xfV0RTX05FVElGX1NUQVJUX1FVRVVFKCBscCApOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHdsX2hjZl9lcnJvciggZGV2LCBzdGF0dXMgKTsJCS8qIFJlcG9ydCB0aGUgZXJyb3IgKi8KLSAgICAgICAgbmV0aWZfZGV2aWNlX2RldGFjaCggZGV2ICk7CQkvKiBTdG9wIHRoZSBkZXZpY2UgYW5kIHF1ZXVlICovCi0gICAgfQorCQluZXRpZl9zdGFydF9xdWV1ZShkZXYpOworCQlXTF9XRFNfTkVUSUZfU1RBUlRfUVVFVUUobHApOworCX0gZWxzZSB7CisJCXdsX2hjZl9lcnJvcihkZXYsIHN0YXR1cyk7CS8qIFJlcG9ydCB0aGUgZXJyb3IgKi8KKwkJbmV0aWZfZGV2aWNlX2RldGFjaChkZXYpOwkvKiBTdG9wIHRoZSBkZXZpY2UgYW5kIHF1ZXVlICovCisJfQogCi0gICAgd2xfdW5sb2NrKCBscCwgJmZsYWdzICk7CisJd2xfdW5sb2NrKGxwLCAmZmxhZ3MpOwogCi0gICAgcmV0dXJuIHN0YXR1czsKLX0gLy8gd2xfb3BlbgorCXJldHVybiBzdGF0dXM7Cit9CQkJCS8qIHdsX29wZW4gKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTM3Nyw3MyArMzUzLDcwIEBACiAgKiAgICAgIGVycm5vIG90aGVyd2lzZQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfY2xvc2UoIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX2Nsb3NlKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgc3RydWN0IHdsX3ByaXZhdGUgICAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgdW5zaWduZWQgbG9uZyAgIGZsYWdzOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IHdsX3ByaXYoZGV2KTsKKwl1bnNpZ25lZCBsb25nIGZsYWdzOwogCi0gICAgREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOworCURCR19QQVJBTShEYmdJbmZvLCAiZGV2IiwgIiVzICgweCVwKSIsIGRldi0+bmFtZSwgZGV2KTsKIAotICAgIC8qIE1hcmsgdGhlIGFkYXB0ZXIgYXMgYnVzeSAqLwotICAgIG5ldGlmX3N0b3BfcXVldWUoIGRldiApOwotICAgIFdMX1dEU19ORVRJRl9TVE9QX1FVRVVFKCBscCApOworCS8qIE1hcmsgdGhlIGFkYXB0ZXIgYXMgYnVzeSAqLworCW5ldGlmX3N0b3BfcXVldWUoZGV2KTsKKwlXTF9XRFNfTkVUSUZfU1RPUF9RVUVVRShscCk7CiAKLSAgICBuZXRpZl9jYXJyaWVyX29mZiggZGV2ICk7Ci0gICAgV0xfV0RTX05FVElGX0NBUlJJRVJfT0ZGKCBscCApOworCW5ldGlmX2NhcnJpZXJfb2ZmKGRldik7CisJV0xfV0RTX05FVElGX0NBUlJJRVJfT0ZGKGxwKTsKIAotICAgIC8qIFNodXRkb3duIHRoZSBhZGFwdGVyOgotICAgICAgICAgICAgRGlzYWJsZSBhZGFwdGVyIGludGVycnVwdHMKLSAgICAgICAgIC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bywgZGV2LT5kZXYucGFyZW50LT5idXNfaWQsCi0JLy8Jc2l6ZW9mKGluZm8tPmJ1c19pbmZvKSk7Ci0gICAgfSBlbHNlIHsKLQlzbnByaW50ZihpbmZvLT5idXNfaW5mbywgc2l6ZW9mKGluZm8tPmJ1c19pbmZvKSwKLQkJIlBDTUNJQSBGSVhNRSIpOwotLy8JCSAgICAiUENNQ0lBIDB4JWx4IiwgcHJpdi0+aHcuaW9iYXNlKTsKLSAgICB9Ci19IC8vIHdsX2dldF9kcnZpbmZvCisJaWYgKGRldi0+ZGV2LnBhcmVudCkgeworCQlkZXZfc2V0X25hbWUoZGV2LT5kZXYucGFyZW50LCAiJXMiLCBpbmZvLT5idXNfaW5mbyk7CisJfSBlbHNlIHsKKwkJc25wcmludGYoaW5mby0+YnVzX2luZm8sIHNpemVvZihpbmZvLT5idXNfaW5mbyksCisJCQkgIlBDTUNJQSBGSVhNRSIpOworCX0KK30JCQkJLyogd2xfZ2V0X2RydmluZm8gKi8KIAogc3RhdGljIHN0cnVjdCBldGh0b29sX29wcyB3bF9ldGh0b29sX29wcyA9IHsKLSAgICAuZ2V0X2RydmluZm8gPSB3bF9nZXRfZHJ2aW5mbywKLSAgICAuZ2V0X2xpbmsgPSBldGh0b29sX29wX2dldF9saW5rLAorCS5nZXRfZHJ2aW5mbyA9IHdsX2dldF9kcnZpbmZvLAorCS5nZXRfbGluayA9IGV0aHRvb2xfb3BfZ2V0X2xpbmssCiB9OwogCi0KIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAgKgl3bF9pb2N0bCgpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNDY0LDgxICs0MzcsODYgQEAKICAqICAgICAgZXJybm8gdmFsdWUgb3RoZXJ3aXNlCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9pb2N0bCggc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCApCitpbnQgd2xfaW9jdGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGlmcmVxICpycSwgaW50IGNtZCkKIHsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgKmxwID0gd2xfcHJpdihkZXYpOwotICAgIHVuc2lnbmVkIGxvbmcgICAgICAgICAgIGZsYWdzOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgIHJldCA9IDA7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOworCXVuc2lnbmVkIGxvbmcgZmxhZ3M7CisJaW50IHJldCA9IDA7CiAKLSAgICBEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7Ci0gICAgREJHX1BBUkFNKERiZ0luZm8sICJycSIsICIweCVwIiwgcnEpOwotICAgIERCR19QQVJBTShEYmdJbmZvLCAiY21kIiwgIjB4JTA0eCIsIGNtZCk7CisJREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOworCURCR19QQVJBTShEYmdJbmZvLCAicnEiLCAiMHglcCIsIHJxKTsKKwlEQkdfUEFSQU0oRGJnSW5mbywgImNtZCIsICIweCUwNHgiLCBjbWQpOwogCi0gICAgd2xfbG9jayggbHAsICZmbGFncyApOworCXdsX2xvY2sobHAsICZmbGFncyk7CiAKLSAgICB3bF9hY3RfaW50X29mZiggbHAgKTsKKwl3bF9hY3RfaW50X29mZihscCk7CiAKICNpZmRlZiBVU0VfUlRTCi0gICAgaWYoIGxwLT51c2VSVFMgPT0gMSApIHsKLQkvKiBIYW5kbG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hdHMgKTsKLSAgICB9CisJLyogSWYgcFN0YXRzIGlzIHN0aWxsIE5VTEwsIHRoZW4gdGhlIGRldmljZSBpcyBub3QgYSBXRFMgcG9ydCAqLworCWlmIChwU3RhdHMgPT0gTlVMTCkKKwkJcFN0YXRzID0gJihscC0+c3RhdHMpOwogCi0gICAgLyogQWNjdW11bGF0ZSB0aGUgdGltZW91dCBlcnJvciAqLwotICAgIHBTdGF0cy0+dHhfZXJyb3JzKys7CisJLyogQWNjdW11bGF0ZSB0aGUgdGltZW91dCBlcnJvciAqLworCXBTdGF0cy0+dHhfZXJyb3JzKys7CiAKLSAgICB3bF91bmxvY2soIGxwLCAmZmxhZ3MgKTsKLX0gLy8gd2xfdHhfdGltZW91dAorCXdsX3VubG9jayhscCwgJmZsYWdzKTsKK30JCQkJLyogd2xfdHhfdGltZW91dCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNjI2LDEwMyArNjA1LDEwNSBAQAogICogICAgICAxIG9uIGVycm9yCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF9zZW5kKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQoraW50IHdsX3NlbmQoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewogCi0gICAgaW50ICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgREVTQ19TVFJDVCAgICAgICAgICAqZGVzYzsKLSAgICBXVkxBTl9MRlJBTUUgICAgICAgICp0eEYgPSBOVUxMOwotICAgIHN0cnVjdCBsaXN0X2hlYWQgICAgKmVsZW1lbnQ7Ci0gICAga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vcnQgPSB0eEYtPmZyYW1lLnBvcnQ7CiAKLSAgICAgICAgICAgIHR4Ri0+ZnJhbWUuc2tiICA9IE5VTEw7Ci0gICAgICAgICAgICB0eEYtPmZyYW1lLnBvcnQgPSAwOworCQkJdHhGLT5mcmFtZS5za2IgPSBOVUxMOworCQkJdHhGLT5mcmFtZS5wb3J0ID0gMDsKIAotICAgICAgICAgICAgbGlzdF9kZWwoICYoIHR4Ri0+bm9kZSApKTsKLSAgICAgICAgICAgIGxpc3RfYWRkKCBlbGVtZW50LCAmKCBscC0+dHhGcmVlICkpOworCQkJbGlzdF9kZWwoJih0eEYtPm5vZGUpKTsKKwkJCWxpc3RfYWRkKGVsZW1lbnQsICYobHAtPnR4RnJlZSkpOwogCi0gICAgICAgICAgICBscC0+dHhRX2NvdW50LS07CisJCQlscC0+dHhRX2NvdW50LS07CiAKLSAgICAgICAgICAgIGlmKCBscC0+dHhRX2NvdW50IDwgVFhfUV9MT1dfV0FURVJfTUFSSyApIHsKLSAgICAgICAgICAgICAgICBpZiggbHAtPm5ldGlmX3F1ZXVlX29uID09IEZBTFNFICkgewotICAgICAgICAgICAgICAgICAgICBEQkdfVFgoIERiZ0luZm8sICJLaWNrc3RhcnRpbmcgUTogJWRcbiIsIGxwLT50eFFfY291bnQgKTsKLSAgICAgICAgICAgICAgICAgICAgbmV0aWZfd2FrZV9xdWV1ZSggbHAtPmRldiApOwotICAgICAgICAgICAgICAgICAgICBXTF9XRFNfTkVUSUZfV0FLRV9RVUVVRSggbHAgKTsKLSAgICAgICAgICAgICAgICAgICAgbHAtPm5ldGlmX3F1ZXVlX29uID0gVFJVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9CisJCQlpZiAobHAtPnR4UV9jb3VudCA8IFRYX1FfTE9XX1dBVEVSX01BUkspIHsKKwkJCQlpZiAobHAtPm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJCURCR19UWChEYm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bmQKKwlyZXR1cm4gVFJVRTsKK30JCQkJLyogd2xfc2VuZCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtNzQ0LDc1ICs3MjUsNzQgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHgoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIGludCBwb3J0ICkKK2ludCB3bF90eChzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBpbnQgcG9ydCkKIHsKLSAgICB1bnNpZ25lZCBsb25nICAgICAgICAgICBmbGFnczsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgICAgICAqbHAgPSB3bF9wcml2KGRldik7Ci0gICAgV1ZMQU5fTEZSQU1FICAgICAgICAgICAgKnR4RiA9IE5VTEw7Ci0gICAgc3RydWN0IGxpc3RfaGVhZCAgICAgICAgKmVsZW1lbnQ7CisJdW5zaWduZWQgbG9uZyBmbGFnczsKKwlzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgPSB3bF9wcml2KGRldik7CisJV1ZMQU5fTEZSQU1FICp0eEYgPSBOVUxMOworCXN0cnVjdCBsaXN0X2hlYWQgKmVsZW1lbnQ7CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0gICAgLyogR3JhYiB0aG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ICovCisJCXR4Ri0+ZnJhbWUuc2tiID0gc2tiOworCQl0eEYtPmZyYW1lLnBvcnQgPSBwb3J0OworCQkvKiBNb3ZlIHRoZSBmcmFtZSB0byB0aGUgdHhRICovCisJCS8qIE5PVEU6IEhlcmUncyB3aGVyZSB3ZSB3b3VsZCBkbyBwcmlvcml0eSBxdWV1ZWluZyAqLworCQlsaXN0X21vdmUoJih0eEYtPm5vZGUpLCAmKGxwLT50eFFbMF0pKTsKIAotICAgICAgICBscC0+dHhRX2NvdW50Kys7Ci0gICAgICAgIGlmKCBscC0+dHhRX2NvdW50ID49IERFRkFVTFRfTlVNX1RYX0ZSQU1FUyApIHsKLSAgICAgICAgICAgIERCR19UWCggRGJnSW5mbywgIlEgRnVsbDogJWRcbiIsIGxwLT50eFFfY291bnQgKTsKLSAgICAgICAgICAgIGlmKCBscC0+bmV0aWZfcXVldWVfb24gPT0gVFJVRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKCBscC0+ZGV2ICk7Ci0gICAgICAgICAgICAgICAgV0xfV0RTX05FVElGX1NUT1BfUVVFVUUoIGxwICk7Ci0gICAgICAgICAgICAgICAgbHAtPm5ldGlmX3F1ZXVlX29uID0gRkFMU0U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgd2xfYWN0X2ludF9vZmYoIGxwICk7IC8qIERpc2FibGUgSW50ZXJydXB0cyAqLworCQlscC0+dHhRX2NvdW50Kys7CisJCWlmIChscC0+dHhRX2NvdW50ID49IERFRkFVTFRfTlVNX1RYX0ZSQU1FUykgeworCQkJREJHX1RYKERiZ0luZm8sICJRIEZ1bGw6ICVkXG4iLCBscC0+dHhRX2NvdW50KTsKKwkJCWlmIChscC0+bmV0aWZfcXVldWVfb24gPT0gVFJVRSkgeworCQkJCW5ldGlmX3N0b3BfcXVldWUobHAtPmRldik7CisJCQkJV0xfV0RTX05FVElGX1NUT1BfUVVFVUUobHApOworCQkJCWxwLT5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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTgzNSw2NyArODE1LDY4IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogaW50IHdsX3J4KHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBzdHJ1Y3Qgc2tfYnVmZiAgICAgICAgICAqc2tiOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICpscCA9IHdsX3ByaXYoZGV2KTsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBzdGF0dXM7Ci0gICAgaGNmXzE2ICAgICAgICAgICAgICAgICAgcGt0bGVuOwotICAgIGhjZl8xNiAgICAgICAgICAgICAgICAgIGhmc19zdGF0OwotICAgIERFU0NfU1RSQ1QgICAgICAgICAgICAgICpkZXNjOworCWludCBwb3J0OworCXN0cnVjdCBza19idWZmICpza2I7CisJc3RydWN0IHdsX3ByaXZhdGUgKmxwID0gd2xfcHJpdihkZXYpOworCWludCBzdGF0dXM7CisJaGNmXzE2IHBrdGxlbjsKKwloY2ZfMTYgaGZzX3N0YXQ7CisJREVTQ19TVFJDVCAqZGVzYzsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBEQkdfUEFSQU0oRGJnSW5mbywgImRldiIsICIlcyAoMHglcCkiLCBkZXYtPm5hbWUsIGRldik7CisJREJHX1BBUkFNKERiZ0luZm8sICJkZXYiLCAiJXMgKDB4JXApIiwgZGV2LT5uYW1lLCBkZXYpOwogCi0gICAgaWYoISggbHAtPmZsYWdzICYgV1ZMQU4yX1VJTF9CVVNZ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AgICAvKiBTZXQgdGhlIG5ldGRldiBiYXNlZCBvbiB0aGUgcG9ydCAqLwotICAgICAgICAgICAgICAgIHN3aXRjaCggcG9ydCApIHsKKwkJcGt0bGVuID0gbHAtPmhjZkN0eC5JRkJfUnhMZW47CisJCWlmIChwa3RsZW4gIT0gMCkgeworCQkJc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7CisJCQlpZiAoc2tiICE9IE5VTEwpIHsKKwkJCQkvKiBTZXQgdGhlIG5ldGRldiBiYXNlZCBvbiB0aGUgcG9ydCAqLworCQkJCXN3aXRjaCAocG9ydCkgewogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgY2FzZSA1OgotICAgICAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJY2FzZSAxOgorCQkJCWNhc2UgMjoKKwkJCQljYXNlIDM6CisJCQkJY2FzZSA0OgorCQkJCWNhc2UgNToKKwkJCQljYXNlIDY6CisJCQkJCXNrYi0+ZGV2ID0gbHAtPndkc19wb3J0W3BvcnQgLSAxXS5kZXY7CisJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWNhc2UgMDoKKwkJCQlkZWZhdWx0OgorCQkJCQlza2ItPmRldiA9IGRldjsKKwkJCQkJYnJlYWs7CisJCQkJfQogCi0gICAgICAgICAgICAgICAgZGVzYyA9ICYoIGxwLT5kZXNjX3J4ICk7CisJCQkJZGVzYyA9ICYobHAtPmRlc2NfcngpOwogCi0gICAgICAgICAgICAgICAgZGVzYy0+bmV4dF9kZXNjX2FkZHIgPSBOVUxMOworCQkJCWRlc2MtPm5leHRfZGVzY19hZGRyID0gTlVMTDsKIAogLyoKICNkZWZpbmUgQkxPQ0tfSU5QVVQoYnVmLCBsZW4pIFwKQEAgLTkwNCw2NyArODg1LDczIEBACiAgICAgc3RhdHVzID0gaGNmX3Jjdl9tc2coJihscC0+aGNmQ3R4KSwgZGVzYywgMCkKICovCiAKLSAgICAgICAgICAgICAgICBHRVRfUEFDS0VUKCBza2ItPmRldiwgc2tiLCBwa3RsZW4gKTsKKwkJCQlHRVRfUEFDS0VUKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICBpZiggc3RhdHVzID09IEhDRl9TVUNDRVNTICkgewotICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJaWYgKHN0YXR1cyA9PSBIQ0ZfU1VDQ0VTUykgeworCQkJCQluZXRpZl9yeChza2IpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfcGFja2V0cysrOwotICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKLSAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAg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QkJCXdsX3NweV9nYXRoZXIoZGV2LCBzcmNhZGRyKTsKKwkJCQkJfQogI2VuZGlmIC8qIFdJUkVMRVNTX1NQWSAqLwogI2VuZGlmIC8qIFdJUkVMRVNTX0VYVCAqLwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIgKTsKKwkJCQl9IGVsc2UgeworCQkJCQlEQkdfRVJST1IoRGJnSW5mbywKKwkJCQkJCSAgIlJ4IHJlcXVlc3QgdG8gY2FyZCBGQUlMRURcbiIpOwogCi0gICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfZHJvcHBlZCsrOwotICAgICAgICAgICAgICAgICAgICB9CisJCQkJCWlmIChwb3J0ID09IDApCisJCQkJCQlscC0+c3RhdHMucnhfZHJvcHBlZCsrOwogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLworCQkJCQllbHNlIHsKKwkJCQkJCWxwLT53ZHNfcG9ydFtwb3J0IC0KKwkJCQkJCQkgICAgIDFdLnN0YXRzLgorCQkJCQkJICAgIHJ4X2Ryb3BwZWQrKzsKKwkJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICBkZXZfa2ZyZWVfc2tiKCBza2IgKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIERCR19FUlJPUiggRGJnSW5mbywgIkNvdWxkIG5vdCBhbGxvYyBza2JcbiIgKTsKKwkJCQkJZGV2X2tmcmVlX3NrYihza2IpOworCQkJCX0KKwkJCX0gZWxzZSB7CisJCQkJREJHX0VSUk9SKERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT5zdGF0cy5yeF9kcm9wcGVkKys7Ci0gICAgICAgICAgICAgICAgfQorCQkJCWlmIChwb3J0ID09IDApCisJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICB9Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KKwkJCQllbHNlIHsKKwkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJICAgICAxXS5zdGF0cy5yeF9kcm9wcGVkKys7CisJCQkJfQorI2VuZGlmIC8qIFVTRV9XRFMgKi8KKwkJCX0KKwkJfQorCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeAorCXJldHVybiAwOworfQkJCQkvKiB3bF9yeCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtOTg2LDE0MiArOTczLDE1OSBAQAogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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kZXZfbWNfY291bnQoZGV2KSk7CiAKLQluZXRkZXZfZm9yX2VhY2hfbWNfYWRkcihoYSwgZGV2KQotCURCR19QUklOVCgiICAgICVwTSAoJWQpXG4iLCBoYS0+YWRkciwgZGV2LT5hZGRyX2xlbik7Ci0gICAgfQorCQluZXRkZXZfZm9yX2VhY2hfbWNfYWRkcihoYSwgZGV2KQorCQkgICAgREJHX1BSSU5UKCIgICAgJXBNICglZClcbiIsIGhhLT5hZGRyLCBkZXYtPmFkZHJfbGVuKTsKKwl9CiAjZW5kaWYgLyogREJHICovCiAKLSAgICBpZighKCBscC0+ZmxhZ3MgJiBXVkxBTjJfVUlMX0JVU1kgKSkgeworCWlmICghKGxwLT5mbGFncyAmIFdWTEFOMl9VSUxfQlVTWSkpIHsKIAogI2lmZGVmIFVTRV9SVFMKLSAgICAgICAgaWYoIGxwLT51c2VSVFMgPT0gMSApIHsKLSAgICAgICAgICAgIERCR19UUkFDRSggRGJnSW5mbywgIlNraXBwaW5nIG11bHRpY2FzdCwgaW4gUlRTIG1vZGVcbiIgKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotI2VuZGlmICAvKiBVU0VfUlRTICovCisJCWlmIChscC0+dXNlUlRTID09IDEpIHsKKwkJCURCR19UUkFDRShEYmdJbmZvLCAiU2tpcHBpbmcgbXVsdGljYXN0LCBpbiBSVFMgbW9kZVxuIik7CisJCQlyZXR1cm47CisJCX0KKyNlbmRpZiAvKiBVU0VfUlRTICovCiAKLSAgICAgICAgd2xfbG9jayggbHAsICZmbGFncyApOwotICAgICAgICB3bF9hY3RfaW50X29mZiggbHAgKTsKKwkJd2xfbG9jayhscCwgJmZsYWdzKTsKKwkJd2xfYWN0X2ludF9vZmYobHApOwogCi0JCWlmICggQ05WX0lOVF9UT19MSVRUTEUoIGxwLT5oY2ZDdHguSUZCX0ZXSWRlbnRpdHkuY29tcF9pZCApID09IENPTVBfSURfRldfU1RBICApIHsKLSAgICAgICAgICAgIGlmKCBkZXYtPmZsYWdzICYgSUZGX1BST01JU0MgKSB7Ci0gICAgICAgICAgICAgICAgLyogRW5hYmxlIHByb21pc2N1b3VzIG1vZGUgKi8KLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLmxlbiAgICAgICA9IDI7Ci0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC50eXAgICAgICAgPSBDRkdfUFJPTUlTQ1VPVVNfTU9ERTsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAxICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgUHJvbWlzY3VvdXMgbW9kZSAoSUZGX1BST01JU0MpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICgobmV0ZGV2X21jX2NvdW50KGRldikgPiBIQ0ZfTUFYX01VTFRJQ0FTVCkgfHwKLSAgICAgICAgICAgICAgICAgICAgKCBkZXYtPmZsYWdzICYgSUZGX0FMTE1VTFRJICkpIHsKLSAgICAgICAgICAgICAgICAvKiBTaHV0dGluZyBvZmYgdGhpcyBmaWx0ZXIgd2lsbCBlbmFibGUgYWxsIG11bHRpY2FzdCBmcmFtZXMgdG8KLSAgICAgICAgICAgICAgICAgICBiZSBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsIHNvCi0gICAgICAgICAgICAgICAgICAgYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAwICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRW5hYmxpbmcgYWxsIG11bHRpY2FzdCBtb2RlIChJRkZfQUxMTVVMVEkpXG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICAgICAgd2xfYXBwbHkoIGxwICk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICghbmV0ZGV2X21jX2VtcHR5KGRldikpIHsKLSAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIG11bHRpY2FzdCBhZGRyZXNzZXMgKi8KLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLmxlbiA9ICggbmV0ZGV2X21jX2NvdW50KGRldikgKiAzICkgKyAxOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwID0gQ0ZHX0dST1VQX0FERFI7CisJCWlmIChDTlZfSU5UX1RPX0xJVFRMRShscC0+aGNmQ3R4LklGQl9GV0lkZW50aXR5LmNvbXBfaWQpID09CisJCSAgICBDT01QX0lEX0ZXX1NUQSkgeworCQkJaWYgKGRldi0+ZmxhZ3MgJiBJRkZfUFJPTUlTQykgeworCQkJCS8qIEVuYWJsZSBwcm9taXNjdW91cyBtb2RlICovCisJCQkJbHAtPmx0dlJlY29yZC5sZW4gPSAyOworCQkJCWxwLT5sdHZSZWNvcmQudHlwID0gQ0ZHX1BST01JU0NVT1VTX01PREU7CisJCQkJbHAtPmx0dlJlY29yZC51LnUxNlswXSA9IENOVl9JTlRfVE9fTElUVExFKDEpOworCQkJCURCR19QUklOVAorCQkJCSAgICAoIkVuYWJsaW5nIFByb21pc2N1b3VzIG1vZGUgKEl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HlwID0gQ0ZHX0dST1VQX0FERFI7CiAKLQkJeCA9IDA7Ci0JCW5ldGRldl9mb3JfZWFjaF9tY19hZGRyKGhhLCBkZXYpCi0gICAgICAgICAgICAgICAgICAgIG1lbWNweSgmKGxwLT5sdHZSZWNvcmQudS51OFt4KysgKiBFVEhfQUxFTl0pLAotCQkJICAgaGEtPmFkZHIsIEVUSF9BTEVOKTsKLSAgICAgICAgICAgICAgICBEQkdfUFJJTlQoICJTZXR0aW5nIG11bHRpY2FzdCBsaXN0XG4iICk7Ci0gICAgICAgICAgICAgICAgaGNmX3B1dF9pbmZvKCAmKCBscC0+aGNmQ3R4ICksIChMVFZQKSYoIGxwLT5sdHZSZWNvcmQgKSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8qIERpc2FibGUgcHJvbWlzY3VvdXMgbW9kZSAqLwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQubGVuICAgICAgID0gMjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnR5cCAgICAgICA9IENGR19QUk9NSVNDVU9VU19NT0RFOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudS51MTZbMF0gID0gQ05WX0lOVF9UT19MSVRUTEUoIDAgKTsKLSAgICAgICAgICAgICAgICBEQkdfUFJJTlQoICJEaXNhYmxpbmcgUHJvbWlzY3VvdXMgbW9kZVxuIiApOwotICAgICAgICAgICAgICAgIGhjZl9wdXRfaW5mbyggJiggbHAtPmhjZkN0eCApLCAoTFRWUCkmKCBscC0+bHR2UmVjb3JkICkpOworCQkJCXggPSAwOworCQkJCW5ldGRldl9mb3JfZWFjaF9tY19hZGRyKGhhLCBkZXYpCisJCQkJICAgIG1lbWNweSgmCisJCQkJCSAgIChscC0+bHR2UmVjb3JkLnUudThbeCsrICogRVRIX0FMRU5dKSwKKwkJCQkJICAgaGEtPmFkZHIsIEVUSF9BTEVOKTsKKwkJCQlEQkdfUFJJTlQoIlNldHRpb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0eCksCisJCQkJCSAgICAgKExUVlApICYgKGxwLT5sdHZSZWNvcmQpKTsKIAotICAgICAgICAgICAgICAgIC8qIFR1cm5pbmcgb24gdGhpcyBmaWx0ZXIgd2lsbCBwcmV2ZW50IGFsbCBtdWx0aWNhc3QgZnJhbWVzIGZyb20KLSAgICAgICAgICAgICAgICAgICBiZWluZyBzZW50IHVwIGZyb20gdGhlIGRldmljZTsgaG93ZXZlciwgdGhpcyBpcyBhIHN0YXRpYyBSSUQsCi0gICAgICAgICAgICAgICAgICAgc28gYSBjYWxsIHRvIHdsX2FwcGx5KCkgaXMgbmVlZGVkICovCi0gICAgICAgICAgICAgICAgbHAtPmx0dlJlY29yZC5sZW4gICAgICAgPSAyOwotICAgICAgICAgICAgICAgIGxwLT5sdHZSZWNvcmQudHlwICAgICAgID0gQ0ZHX0NORl9SWF9BTExfR1JPVVBfQUREUjsKLSAgICAgICAgICAgICAgICBscC0+bHR2UmVjb3JkLnUudTE2WzBdICA9IENOVl9JTlRfVE9fTElUVExFKCAxICk7Ci0gICAgICAgICAgICAgICAgREJHX1BSSU5UKCAiRGlzYWJsaW5nIGFsbCBtdWx0aWNhc3QgbW9kZSAoSUZGX0FMTE1VTFRJKVxuIiApOwotICAgICAgICAgICAgICAgIGhjZl9wdXRfaW5mbyggJiggbHAtPmhjZkN0eCApLCAoTFRWUCkmKCBscC0+bHR2UmVjb3JkICkpOwotICAgICAgICAgICAgICAgIHdsX2FwcGx5KCBscCApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHdsX2FjdF9pbnRfb24oIGxwICk7Ci0Jd2xfdW5sb2NrKCBscCwgJmZsYWdzICk7Ci0gICAgfQorCQkJCS8qCisJCQkJICogVHVybmluZyBvbiB0aGlzIGZpbHRlciB3aWxsIHByZXZlbnQgYWxsIG11bHRpY2FzdCBmcmFtZXMgZnJvbQorCQkJCSAqIGJlaW5nIHNlbnQgdXAgZnJvbSB0aGUgZGV2aWNlOyBob3dldmVyLCB0a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F0cywKKwkubmRvX3NldF9yeF9tb2RlID0gJndsX211bHRpY2FzdCwKIAotICAgIC5uZG9faW5pdCAgICAgICAgICAgICAgID0gJndsX2luc2VydCwKLSAgICAubmRvX29wZW4gICAgICAgICAgICAgICA9ICZ3bF9hZGFwdGVyX29wZW4sCi0gICAgLm5kb19zdG9wICAgICAgICAgICAgICAgPSAmd2xfYWRhcHRlcl9jbG9zZSwKLSAgICAubmRvX2RvX2lvY3RsICAgICAgICAgICA9ICZ3bF9pb2N0bCwKKwkubmRvX2luaXQgPSAmd2xfaW5zZXJ0LAorCS5uZG9fb3BlbiA9ICZ3bF9hZGFwdGVyX29wZW4sCisJLm5kb19zdG9wID0gJndsX2FkYXB0ZXJfY2xvc2UsCisJLm5kb19kb19pb2N0bCA9ICZ3bF9pb2N0bCwKIAotICAgIC5uZG9fdHhfdGltZW91dCAgICAgICAgID0gJndsX3R4X3RpbWVvdXQsCisJLm5kb190eF90aW1lb3V0ID0gJndsX3R4X3RpbWVvdXQsCiAKICNpZmRlZiBDT05GSUdfTkVUX1BPTExfQ09OVFJPTExFUgotICAgIC5uZG9fcG9sbF9jb250cm9sbGVyICAgID0gd2xfcG9sbCwKKwkubmRvX3BvbGxfY29udHJvbGxlciA9IHdsX3BvbGwsCiAjZW5kaWYKIH07CiAKQEAgLTExNDQsNDggKzExNDgsNTEgQEAKICAqICAgICAgZGV2aWNlLgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgbmV0X2RldmljZSAqIHdsX2RldmljZV9hbGxvYyggdm9pZCApCitzdHJ1Y3QgbmV0X2RldmljZSAqd2xfZGV2aWNlX2FsbG9jKHZvaWQpCiB7Ci0gICAgc3RydWN0IG5ldF9kZXZpY2UgICAqZGV2ID0gTlVMTDsKLSAgICBzdHJ1Y3Qgd2xfcHJpdmF0ZSAgICpscCA9IE5VTEw7CisJc3RydW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oZG9nX3RpbWVvICAgICA9IFRYX1RJTUVPVVQ7CisJZGV2LT5ldGh0b29sX29wcyA9ICZ3bF9ldGh0b29sX29wczsKIAotICAgIGRldi0+ZXRodG9vbF9vcHMJICAgID0gJndsX2V0aHRvb2xfb3BzOworCW5ldGlmX3N0b3BfcXVldWUoZGV2KTsKIAotICAgIG5ldGlmX3N0b3BfcXVldWUoIGRldiApOworCS8qIEFsbG9jYXRlIHZpcnR1YWwgZGV2aWNlcyBmb3IgV0RTIHN1cHBvcnQgaWYgbmVlZGVkICovCisJV0xfV0RTX0RFVklDRV9BTExPQyhscCk7CiAKLSAgICAvKiBBbGxvY2F0ZSB2aXJ0dWFsIGRldmljZXMgZm9yIFdEUyBzdXBwb3J0IGlmIG5lZWRlZCAqLwotICAgIFdMX1dEU19ERVZJQ0VfQUxMT0MoIGxwICk7CisJcmV0dXJuIGRldjsKK30JCQkJLyogd2xfZGV2aWNlX2FsbG9jICovCiAKLSAgICByZXR1cm4gZGV2OwotfSAvLyB3bF9kZXZpY2VfYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjA2LDE1ICsxMjEzLDE0IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX2RldmljZV9kZWFsbG9jKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK3ZvaWQgd2xfZGV2aWNlX2RlYWxsb2Moc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLS8vICAgIHN0cnVjdCB3bF9wcml2YXRlICAgKmxwID0gd2xfcHJpdihkZXYpOworCS8qIERlYWxsb2MgdGhlIFdEUyBwb3J0cyAqLworCVdMX1dEU19ERVZJQ0VfREVBTExPQyhscCk7CiAKLSAgICAvKiBEZWFsbG9jIHRoZSBXRFMgcG9ydHMgKi8KLSAgICBXTF9XRFNfREVWSUNFX0RFQUxMT0MoIGxwICk7CisJZnJlZV9uZXRkZXYoZGV2KTsKK30JCQkJLyogd2xfZGV2aWNlX2RlYWxsb2MgKi8KIAotICAgIGZyZWVfbmV0ZGV2KCBkZXYgKTsKLX0gLy8gd2xfZGV2aWNlX2RlYWxsb2MKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMjM1LDE1ICsxMjQxLDE2IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDAoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQwKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAwXG4iICk7CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDBcbiIpOwogCi0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMCApOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjaWZkZWYgRU5BQkxFX0RNQQotICAgIHJldHVybiB3bF90eF9kbWEoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8wICk7CisJcmV0dXJuIHdsX3R4X2RtYShza2IsIGRldiwgSENGX1BPUlRfMCk7CiAjZW5kaWYKLX0gLy8gd2xfdHhfcG9ydDAKK30JCQkJLyogd2xfdHhfcG9ydDBpICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKICNpZmRlZiBVU0VfV0RTCkBAIC0xMjY2LDExICsxMjczLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDEoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQxKHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfMSApOwotfSAvLyB3bF90eF9wb3J0MQorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCAxXG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzEpOworfQkJCQkvKiB3bF90eF9wb3J0MSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTI5MSwxMSArMTI5OSwxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQyKCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0MihzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzIgKTsKLX0gLy8gd2xfdHhfcG9ydDIKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgMlxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF8yKTsKK30JCQkJLyogd2xfdHhfcG9ydDIgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzMTYsMTEgKzEzMjUsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Myggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDMoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF8zICk7Ci19IC8vIHdsX3R4X3BvcnQzCisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDNcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfMyk7Cit9CQkJCS8qIHdsX3R4X3BvcnQzICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xMzQxLDExICsxMzUxLDEyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfdHhfcG9ydDQoIHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYgKQoraW50IHdsX3R4X3BvcnQ0KHN0cnVjdCBza19idWZmICpza2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7Ci0gICAgREJHX1RYKCBEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iICk7Ci0gICAgcmV0dXJuIHdsX3R4KCBza2IsIGRldiwgSENGX1BPUlRfNCApOwotfSAvLyB3bF90eF9wb3J0NAorCURCR19UWChEYmdJbmZvLCAiVHggb24gUG9ydCA0XG4iKTsKKwlyZXR1cm4gd2xfdHgoc2tiLCBkZXYsIEhDRl9QT1JUXzQpOworfQkJCQkvKiB3bF90eF9wb3J0NCAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTM2NiwxMSArMTM3NywxMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IHdsX3R4X3BvcnQ1KCBzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF90eF9wb3J0NShzdHJ1Y3Qgc2tfYnVmZiAqc2tiLCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotICAgIERCR19UWCggRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIiApOwotICAgIHJldHVybiB3bF90eCggc2tiLCBkZXYsIEhDRl9QT1JUXzUgKTsKLX0gLy8gd2xfdHhfcG9ydDUKKwlEQkdfVFgoRGJnSW5mbywgIlR4IG9uIFBvcnQgNVxuIik7CisJcmV0dXJuIHdsX3R4KHNrYiwgZGV2LCBIQ0ZfUE9SVF81KTsKK30JCQkJLyogd2xfdHhfcG9ydDUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTEzOTEsMTEgKzE0MDMsMTIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCB3bF90eF9wb3J0Niggc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldiApCitpbnQgd2xfdHhfcG9ydDYoc3RydWN0IHNrX2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBEQkdfVFgoIERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIgKTsKLSAgICByZXR1cm4gd2xfdHgoIHNrYiwgZGV2LCBIQ0ZfUE9SVF82ICk7Ci19IC8vIHdsX3R4X3BvcnQ2CisJREJHX1RYKERiZ0luZm8sICJUeCBvbiBQb3J0IDZcbiIpOworCXJldHVybiB3bF90eChza2IsIGRldiwgSENGX1BPUlRfNik7Cit9CQkJCS8qIHdsX3R4X3BvcnQ2ICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDE3LDUwICsxNDMwLDUyIEBACiAgKiAgICAgIHN0cnVjdHMgaW4gdGhlIHByaXZhdGUgYWRhcHRlciBzdHJ1Y3R1cmUuCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfd2RzX2RldmljZV9hbGxvYyggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX2RldmljZV9hbGxvYyhzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7Ci0gICAgaW50IGNvdW50OworCWludCBjb3VudDsKIAotICAgIC8qIFdEUyBzdXBwb3J0IHJlcXVpcmVzIGFkZGl0aW9uYWwgbmV0X2RldmljZSBzdHJ1Y3RzIHRvIGJlIGFsbG9jYXRlZCwKLSAgICAgICBzbyB0aGF0IHVzZXIgc3BhY2UgYXBwcyBjYW4gdXNlIHRoZXNlIHZpcnR1YWwgZGV2aWNlcyB0byBzcGVjaWZ5IHRoZQotICAgICAgIHBvcnQgb24gd2hpY2ggdG8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09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNDgwLDI2ICsxNDk1LDI3IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19kZXZpY2VfZGVhbGxvYyggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX2RldmljZV9kZWFsbG9jKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogCi0gICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1JUUzsgY291bnQrKyApIHsKLSAgICAgICAgc3RydWN0IG5ldF9kZXZpY2UgKmRldl93ZHMgPSBOVUxMOworCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJc3RydWN0IG5ldF9kZXZpY2UgKmRldl93ZHMgPSBOVUxMOwogCi0gICAgICAgIGRldl93ZHMgPSBscC0+d2RzX3BvcnRbY291bnRdLmRldjsKKwkJZGV2X3dkcyA9IGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2OwogCi0gICAgICAgIGlmKCBkZXZfd2RzICE9IE5VTEwgKSB7Ci0gICAgICAgICAgICBpZiggZGV2X3dkcy0+ZmxhZ3MgJiBJRkZfVVAgKSB7Ci0gICAgICAgICAgICAgICAgZGV2X2Nsb3NlKCBkZXZfd2RzICk7Ci0gICAgICAgICAgICAgICAgZGV2X3dkcy0+ZmxhZ3MgJj0gfiggSUZGX1VQIHwgSUZGX1JVTk5JTkcgKTsKLSAgICAgICAgICAgIH0KKwkJaWYgKGRldl93ZHMgIT0gTlVMTCkgeworCQkJaWYgKGRldl93ZHMtPmZsYWdzICYgSUZGX1VQKSB7CisJCQkJZGV2X2Nsb3NlKGRldl93ZHMpOworCQkJCWRldl93ZHMtPmZsYWdzICY9IH4oSUZGX1VQIHwgSUZGX1JVTk5JTkcpOworCQkJfQogCi0gICAgICAgICAgICBmcmVlX25ldGRldihkZXZfd2RzKTsKLSAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ID0gTlVMTDsKLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX2RldmljZV9kZWFsbG9jCisJCQlmcmVlX25ldGRldihkZXZfd2RzKTsKKwkJCWxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ID0gTlVMTDsKKwkJfQorCX0KK30JCQkJLyogd2xfd2RzX2RldmljZV9kZWFsbG9jICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNTIwLDIxICsxNTM2LDIyIEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3N0YXJ0X3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gRkFMU0UgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfc3RhcnRfcXVldWUoIGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2ICk7Ci0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19IC8vIHdsX3dkc19uZXRpZl9zdGFydF9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfc3RhcnRfcXVldWUobHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQkJCWxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RhcnRfcXVldWUgKi8KKwogLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKQEAgLTE1NTUsMjEgKzE1NzIsMjIgQEAKICAqICAgICAgTi9BCiAgKgogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgd2xfd2RzX25ldGlmX3N0b3BfcXVldWUoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9zdG9wX3F1ZXVlKHN0cnVjdCB3bF9wcml2YXRlICpscCkKIHsKLSAgICBpbnQgY291bnQ7CisJaW50IGNvdW50OwogICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KIAotICAgIGlmKCBscCAhPSBOVUxMICkgewotICAgICAgICBmb3IoIGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrICkgewotICAgICAgICAgICAgaWYoIGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCAmJgotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPT0gVFJVRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl9zdG9wX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBGQUxTRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX3N0b3BfcXVldWUKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCisJCQkgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBUUlVFKSB7CisJCQkJbmV0aWZfc3RvcF9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IEZBTFNFOworCQkJfQorCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfc3RvcF9xdWV1ZSAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTU5MCwyMSArMTYwOCwyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZSggc3RydWN0IHdsX3ByaXZhdGUgKmxwICkKK3ZvaWQgd2xfd2RzX25ldGlmX3dha2VfcXVldWUoc3RydWN0IHdsX3ByaXZhdGUgKmxwKQogewotICAgIGludCBjb3VudDsKKwlpbnQgY291bnQ7CiAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwogCi0gICAgaWYoIGxwICE9IE5VTEwgKSB7Ci0gICAgICAgIGZvciggY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KysgKSB7Ci0gICAgICAgICAgICBpZiggbHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkICYmCi0gICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9PSBGQUxTRSApIHsKLSAgICAgICAgICAgICAgICBuZXRpZl93YWtlX3F1ZXVlKCBscC0+d2RzX3BvcnRbY291bnRdLmRldiApOwotICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtjb3VudF0ubmV0aWZfcXVldWVfb24gPSBUUlVFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfSAvLyB3bF93ZHNfbmV0aWZfd2FrZV9xdWV1ZQorCWlmIChscCAhPSBOVUxMKSB7CisJCWZvciAoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKKwkJCWlmIChscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgJiYKKwkJCSAgICBscC0+d2RzX3BvcnRbY291bnRdLm5ldGlmX3F1ZXVlX29uID09IEZBTFNFKSB7CisJCQkJbmV0aWZfd2FrZV9xdWV1ZShscC0+d2RzX3BvcnRbY291bnRdLmRldik7CisJCQkJbHAtPndkc19wb3J0W2NvdW50XS5uZXRpZl9xdWV1ZV9vbiA9IFRSVUU7CisJCQl9CisJCX0KKwl9Cit9CQkJCS8qIHdsX3dkc19uZXRpZl93YWtlX3F1ZXVlICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNjI1LDE5ICsxNjQ0LDE5IEBACiAgKiAgICAgIE4vQQogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29uKCBzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHAgKQordm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7Ci0gICAgaW50IGNvdW50OworCWludCBjb3VudDsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBpZiggbHAgIT0gTlVMTCApIHsKLSAgICAgICAgZm9yKCBjb3VudCA9IDA7IGNvdW50IDwgTlVNX1dEU19QT1JUUzsgY291bnQrKyApIHsKLSAgICAgICAgICAgIGlmKCBscC0+d2RzX3BvcnRbY291bnRdLmlzX3JlZ2lzdGVyZWQgKSB7Ci0gICAgICAgICAgICAgICAgbmV0aWZfY2Fycmllcl9vbiggbHAtPndkc19wb3J0W2NvdW50XS5kZXYgKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0gLy8gd2xfd2RzX25ldGlmX2NhcnJpZXJfb24KKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQorCQkJCW5ldGlmX2NhcnJpZXJfb24obHAtPndkc19wb3J0W2NvdW50XS5kZXYpOworCQl9CisJfQorfQkJCQkvKiB3bF93ZHNfbmV0aWZfY2Fycmllcl9vbiAqLworCiAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwogCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpAQCAtMTY1OCwyMSArMTY3NywyMiBAQAogICogICAgICBOL0EKICAqCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYoIHN0cnVjdCB3bF9wcml2YXRlICpscCApCit2b2lkIHdsX3dkc19uZXRpZl9jYXJyaWVyX29mZihzdHJ1Y3Qgd2xfcHJpdmF0ZSAqbHApCiB7CiAJaW50IGNvdW50OwogCi0JaWYobHAgIT0gTlVMTCkgewotCQlmb3IoY291bnQgPSAwOyBjb3VudCA8IE5VTV9XRFNfUE9SVFM7IGNvdW50KyspIHsKLQkJCWlmKGxwLT53ZHNfcG9ydFtjb3VudF0uaXNfcmVnaXN0ZXJlZCkKKwlpZiAobHAgIT0gTlVMTCkgeworCQlmb3IgKGNvdW50ID0gMDsgY291bnQgPCBOVU1fV0RTX1BPUlRTOyBjb3VudCsrKSB7CisJCQlpZiAobHAtPndkc19wb3J0W2NvdW50XS5pc19yZWdpc3RlcmVkKQogCQkJCW5ldGlmX2NhcnJpZXJfb2ZmKGxwLT53ZHNfcG9ydFtjb3VudF0uZGV2KTsKIAkJfQogCX0KIAotfSAvLyB3bF93ZHNfbmV0aWZfY2Fycmllcl9vZmYKK30JCQkJLyogd2xfd2RzX25ldGlmX2NhcnJpZXJfb2ZmICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKLSNlbmRpZiAgLyogVVNFX1dEUyAqLworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAogI2lmZGVmIEVOQUJMRV9ETUEKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNjk1LDcwICsxNzE1LDcxIEBACiAgKiAgICAgIDEgb24gZXJyb3IKICAqCiAgKioqKioqKioqKioqKio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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCiAKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCkBAIC0xNzc5LDE0NyArMTgwMCwxNTIgQEAKICAqICAgICAgMSBvbiBlcnJvcgogICoKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgd2xfcnhfZG1hKCBzdHJ1Y3QgbmV0X2RldmljZSAqZGV2ICkKK2ludCB3bF9yeF9kbWEoc3RydWN0IG5ldF9kZXZpY2UgKmRldikKIHsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgcG9ydDsKLSAgICBoY2ZfMTYgICAgICAgICAgICAgICAgICAgcGt0bGVuOwotICAgIGhjZl8xNiAgICAgICAgICAgICAgICAgICBoZnNfc3RhdDsKLSAgICBzdHJ1Y3Qgc2tfYnVmZiAgICAgICAgICAqc2tiOwotICAgIHN0cnVjdCB3bF9wcml2YXRlICAgICAgICpscCA9IE5VTEw7Ci0gICAgREVTQ19TVFJDVCAgICAgICAgICAgICAgKmRlc2MsICpkZXNjX25leHQ7Ci0gICAgLy9DRkdfTUJfSU5GT19SQU5HRTJfU1RSQ1QgeDsKKwlpbnQgcG9ydDsKKwloY2ZfMTYgcGt0bGVuOworCWhjZl8xNiBoZnNfc3RhdDsKKwlzdHJ1Y3Qgc2tfYnVmZiAqc2tiOworCXN0cnVjdCB3bF9wcml2YXRlICpscCA9IE5VTEw7CisJREVTQ19TVFJDVCAqZGVzYywgKmRlc2NfbmV4dDsKICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCiAKLSAgICBEQkdfUEFSQU0oRGJnSW5mbywgImRldiI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JCQlyZXR1cm4gLUVJTzsKKwkJCX0KIAotICAgICAgICAgICAgICAgIC8qIERldGVybWluZSB3aGF0IHBvcnQgdGhpcyBwYWNrZXQgaXMgZm9yICovCi0gICAgICAgICAgICAgICAgcG9ydCA9ICggaGZzX3N0YXQgPj4gOCApICYgMHgwMDA3OwotICAgICAgICAgICAgICAgIERCR19SWCggRGJnSW5mbywgIlJ4IGZyYW1lIGZvciBwb3J0ICVkXG4iLCBwb3J0ICk7CisJCQkvKiBEZXRlcm1pbmUgd2hhdCBwb3J0IHRoaXMgcGFja2V0IGlzIGZvciAqLworCQkJcG9ydCA9IChoZnNfc3RhdCA+PiA4KSAmIDB4MDAwNzsKKwkJCURCR19SWChEYmdJbmZvLCAiUnggZnJhbWUgZm9yIHBvcnQgJWRcbiIsIHBvcnQpOwogCi0gICAgICAgICAgICAgICAgcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKLSAgICAgICAgICAgICAgICBpZiAocGt0bGVuICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc2tiID0gQUxMT0NfU0tCKHBrdGxlbik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChza2IgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoKCBwb3J0ICkgeworCQkJcGt0bGVuID0gR0VUX0JVRl9DTlQoZGVzY19uZXh0KTsKKwkJCWlmIChwa3RsZW4gIT0gMCkgeworCQkJCXNrYiA9IEFMTE9DX1NLQihwa3RsZW4pOworCQkJCWlmIChza2IgIT0gTlVMTCkgeworCQkJCQlzd2l0Y2ggKHBvcnQpIHsKICNpZmRlZiBVU0VfV0RTCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tiLT5kZXYgPSBscC0+d2RzX3BvcnRbcG9ydC0xXS5kZXY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0jZW5kaWYgIC8qIFVTRV9XRFMgKi8KKwkJCQkJY2FzZSAxOgorCQkJCQljYXNlIDI6CisJCQkJCWNhc2UgMzoKKwkJCQkJY2FzZSA0OgorCQkJCQljYXNlIDU6CisJCQkJCWNhc2UgNjoKKwkJCQkJCXNrYi0+ZGV2ID0KKwkJCQkJCSAgICBscC0+d2RzX3BvcnRbcG9ydCAtIDFdLmRldjsKKwkJCQkJCWJyZWFrOworI2VuZGlmIC8qIFVTRV9XRFMgKi8KIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2ItPmRldiA9IGRldjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJY2FzZSAwOgorCQkJCQlkZWZhdWx0OgorCQkJCQkJc2tiLT5kZXYgPSBkZXY7CisJCQkJCQlicmVhazsKKwkJCQkJfQogCi0gICAgICAgICAgICAgICAgICAgICAgICBHRVRfUEFDS0VUX0RNQSggc2tiLT5kZXYsIHNrYiwgcGt0bGVuICk7CisJCQkJCUdFVF9QQUNLRVRfRE1BKHNrYi0+ZGV2LCBza2IsIHBrdGxlbik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCi0gICAgICAgICAgICAgICAgICAgICAgICBoY2ZfZG1hX3J4X3B1dCggJiggbHAtPmhjZkN0eCApLCBkZXNjICk7CisJCQkJCS8qIEdpdmUgdGhlIGRlc2NyaXB0b3IgYmFjayB0byB0aGUgSENGICovCisJCQkJCWhjZl9kbWFfcnhfcHV0KCYobHAtPmhjZkN0eCksIGRlc2MpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBuZXRpZl9yeCggc2tiICk7CisJCQkJCW5ldGlmX3J4KHNrYik7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBwb3J0ID09IDAgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X3BhY2tldHMrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+c3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQorCQkJCQlpZiAocG9ydCA9PSAwKSB7CisJCQkJCQlscC0+c3RhdHMucnhfcGFja2V0cysrOworCQkJCQkJbHAtPnN0YXRzLnJ4X2J5dGVzICs9IHBrdGxlbjsKKwkJCQkJfQogI2lmZGVmIFVTRV9XRFMKLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscC0+d2RzX3BvcnRbcG9ydC0xXS5zdGF0cy5yeF9wYWNrZXRzKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHAtPndkc19wb3J0W3BvcnQtMV0uc3RhdHMucnhfYnl0ZXMgKz0gcGt0bGVuOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotI2VuZGlmICAvKiBVU0VfV0RTICovCisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfcGFja2V0cysrOworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfYnl0ZXMgKz0gcGt0bGVuOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLwogCi0gICAgICAgICAgICAgICAgICAgICAgICBkZXYtPmxhc3RfcnggPSBqaWZmaWVzOworCQkJCQlkZXYtPmxhc3RfcnggPSBqaWZmaWVzOwogCi0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQkdfRVJST1IoIERiZ0luZm8sICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iICk7CisJCQkJfSBlbHNlIHsKKwkJCQkJREJHX0VSUk9SKERiZ0luZm8sCisJCQkJCQkgICJDb3VsZCBub3QgYWxsb2Mgc2tiXG4iKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBvcnQgPT0gMCApCi0JICAgICAgICAgICAgICAgICAgICB7Ci0JICAgICAgICAgICAgICAgICAgICAgICAgbHAtPnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLQkgICAgICAgICAgICAgICAgICAgIH0KKwkJCQkJaWYgKHBvcnQgPT0gMCkKKwkJCQkJCWxwLT5zdGF0cy5yeF9kcm9wcGVkKys7CiAjaWZkZWYgVVNFX1dEUwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxwLT53ZHNfcG9ydFtwb3J0LTFdLnN0YXRzLnJ4X2Ryb3BwZWQrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZiAgLyogVVNFX1dEUyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAvL30KLSAgICB9CisJCQkJCWVsc2UgeworCQkJCQkJbHAtPndkc19wb3J0W3BvcnQgLQorCQkJCQkJCSAgICAgMV0uc3RhdHMuCisJCQkJCQkgICAgcnhfZHJvcHBlZCsrOworCQkJCQl9CisjZW5kaWYgLyogVVNFX1dEUyAqLworCQkJCX0KKwkJCX0KKwkJfQorCQkvKn0qLworCX0KIAotICAgIHJldHVybiAwOwotfSAvLyB3bF9yeF9kbWEKKwlyZXR1cm4gMDsKK30JCQkJLyogd2xfcnhfZG1hICovCisKIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0jZW5kaWYgIC8vIEVOQUJMRV9ETUEKKyNlbmRpZiAvKiBFTkFCTEVfRE1BICovCmRpZmYgLS1naXQgYS9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMgYi9kcml2ZXJzL3N0YWdpbmcvd2xhZ3M0OV9oMi93bF91dGlsLmMKaW5kZXggNGNhNmU0Mi4uNzUwMTljMSAxMDA2NDQKLS0tIGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfdXRpbC5jCisrKyBiL2RyaXZlcnMvc3RhZ2luZy93bGFnczQ5X2gyL3dsX3V0aWwuYwpAQCAtMTYxLDQzICsxNjEsNiBAQAogCiAKIAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoJcGVyY2VudCgpCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqICBERVNDUklQVElPTjoKLSAqCi0gKiAgICAgIFJldHVybiBhIHZhbHVlIGFzIGEgcGVyY2VudGFnZSBvZiBtaW4gdG8gbWF4LgotICoKLSAqICBQQVJBTUVURVJTOgotICoKLSAqICAgICAgdmFsdWUgICAtIHRoZSB2YWx1ZSBpbiBxdWVzdGlvbgotICogICAgICBtaW4gICAgIC0gdGhlIG1pbmltdW0gcmFuZ2UgdmFsdWUKLSAqICAgICAgbWF4ICAgICAtIHRoZSBtYXhpbXVtIHJhbmdlIHZhbHVlCi0gKgotICogIFJFVFVSTlM6Ci0gKgotICogICAgICB0aGUgcGVyY2VudGFnZSB2YWx1ZQotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgcGVyY2VudCggaW50IHZhbHVlLCBpbnQgbWluLCBpbnQgbWF4ICkKLXsKLSAgICAvKiBUcnVuY2F0ZSB0aGUgdmFsdWUgdG8gYmUgYmV0d2VlbiBtaW4gYW5kIG1heC4gKi8KLSAgICBpZiggdmFsdWUgPCBtaW4gKQotICAgICAgICB2YWx1ZSA9IG1pbjsKLQotICAgIGlmKCB2YWx1ZSA+IG1heCApCi0gICAgICAgIHZhbHVlID0gbWF4OwotCi0gICAgLyogUmV0dXJuIHRoZSB2YWx1ZSBhcyBhIHBlcmNlbnRhZ2Ugb2YgbWluIHRvIG1heC4gKi8KLSAgICByZXR1cm4gKCgoIHZhbHVlIC0gbWluICkgKiAxMDAgKSAvICggbWF4IC0gbWluICkpOwotfSAvLyBwZXJjZW50Ci0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi0KLQotCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICoJaXNfdmFsaWRfa2V5X3N0cmluZygpCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpkaWZmIC0tZ2l0IGEvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd2V4dC5jIGIvZHJpdmVycy9zdGFnaW5nL3dsYWdzNDlfaDIvd2xfd2V4dC5jCmluZGV4IDE4N2ZjMDYuLjQ5ZWVlYWUgMTAwNjQ0Ci0tLSBhL2RyaXZlc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cy5oCisrKyBiL2luY2x1ZGUvYWNwaS9hY3R5cGVzLmgKQEAgLTUsNyArNSw3IEBACiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKIC8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDAgLSAyMDEzLCBJbnRlbCBDb3JwLgorICogQ29weXJpZ2h0IChDKSAyMDAwIC0gMjAxNCwgSW50ZWwgQ29ycC4KICAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgKgogICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0CkBAIC01NSwxOCArNTUsMTYgQEAKICNlcnJvciBBQ1BJX01BQ0hJTkVfV0lEVEggbm90IGRlZmluZWQKICNlbmRpZgogCi0vKiEgW0JlZ2luXSBubyBzb3VyY2UgY29kZSB0cmFuc2xhdGlvbiAqLwotCiAvKgogICogRGF0YSB0eXBlIHJhbmdlcwogICogTm90ZTogVGhlc2UgbWFjcm9zIGFyZSBkZXNpZ25lZCB0byBiZSBjb21waWxlciBpbmRlcGVuZGVudCBhcyB3ZWxsIGFzCiAgKiB3b3JraW5nIGFyb3VuZCBwcm9ibGVtcyB0aGF0IHNvbWUgMzItYml0IGNvbXBpbGVycyBoYXZlIHdpdGggNjQtYml0CiAgKiBjb25zdGFudHMuCiAgKi8KLSNkZWZpbmUgQUNQSV9VSU5UOF9NQVggICAgICAgICAgICAgICAgICAoVUlOVDgpICh+KChVSU5UOCkgIDApKQkvKiAweEZGICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQUNQSV9VSU5UMTZfTUFYICAgICAgICAgICAgICAgICAoVUlOVDE2KSh+KChVSU5UMTYpIDApKQkvKiAweEZGRkYgICAgICAgICAgICAgKi8KLSNkZWZpbmUgQUNQSV9VSU5UMzJfTUFYICAgICAgICAgICAgICAgIC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lZCBpbnQgdmFsKSwKKworCVRQX0FSR1Mob2Zmc2V0LCB2YWwpCisKKyk7CisKK0RFRklORV9FVkVOVChzc3RfaXBjX21haWxib3gsIHNzdF9pcGNfb3V0Ym94X3JkYXRhLAorCisJVFBfUFJPVE8odW5zaWduZWQgaW50IG9mZnNldCwgdW5zaWduZWQgaW50IHZhbCksCisKKwlUUF9BUkdTKG9mZnNldCwgdmFsKQorCispOworCitERUZJTkVfRVZFTlQoc3N0X2lwY19tYWlsYm94LCBzc3RfaXBjX291dGJveF93ZGF0YSwKKworCVRQX1BST1RPKHVuc2lnbmVkIGludCBvZmZzZXQsIHVuc2lnbmVkIGludCB2YWwpLAorCisJVFBfQVJHUyhvZmZzZXQsIHZhbCkKKworKTsKKworREVDTEFSRV9FVkVOVF9DTEFTUyhzc3RfaXBjX21haWxib3hfaW5mbywKKworCVRQX1BST1RPKHVuc2lnbmVkIGludCBzaXplKSwKKworCVRQX0FSR1Moc2l6ZSksCisKKwlUUF9TVFJVQ1RfX2VudHJ5KAorCQlfX2ZpZWxkKAl1bnNpZ25lZCBpbnQsCXNpemUJCSkKKwkpLAorCisJVFBfZmFzdF9hc3NpZ24oCisJCV9fZW50cnktPnNpemUgPSBzaXplOworCSksCisKKwlUUF9wcmludGsoIk1haWxib3ggYnl0ZXMgMHglOC44eCIsICh1bnNpZ25lZCBpbnQpX19lbnRyeS0+c2l6ZSkKKyk7CisKK0RFRklORV9FVkVOVChzc3RfaXBjX21haWxib3hfaW5mbywgc3N0X2lwY19pbmJveF9yZWFkLAorCisJVFBfUFJPVE8odW5zaWduZWQgaW50IHNpemUpLAorCisJVFBfQVJHUyhzaXplKQorCispOworCitERUZJTkVfRVZFTlQoc3N0X2lwY19tYWlsYm94X2luZm8sIHNzdF9pcGNfaW5ib3hfd3JpdGUsCisKKwlUUF9QUk9UTyh1bnNpZ25lZCBpbnQgc2l6ZSksCisKKwlUUF9BUkdTKHNpemUpCisKKyk7CisKK0RFRklORV9FVkVOVChzc3Rf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SwgdTMyIF9faW9tZW0gKmFkZHIpCit7CisJd3JpdGVsKHZhbHVlLCBhZGRyKTsKK30KKworc3RhdGljIHUzMiBwY2lfYXp4X3JlYWRsKHUzMiBfX2lvbWVtICphZGRyKQoreworCXJldHVybiByZWFkbChhZGRyKTsKK30KKworc3RhdGljIHZvaWQgcGNpX2F6eF93cml0ZXcodTE2IHZhbHVlLCB1MTYgX19pb21lbSAqYWRkcikKK3sKKwl3cml0ZXcodmFsdWUsIGFkZHIpOworfQorCitzdGF0aWMgdTE2IHBjaV9henhfcmVhZHcodTE2IF9faW9tZW0gKmFkZHIpCit7CisJcmV0dXJuIHJlYWR3KGFkZHIpOworfQorCitzdGF0aWMgdm9pZCBwY2lfYXp4X3dyaXRlYih1OCB2YWx1ZSwgdTggX19pb21lbSAqYWRkcikKK3sKKwl3cml0ZWIodmFsdWUsIGFkZHIpOworfQorCitzdGF0aWMgdTggcGNpX2F6eF9yZWFkYih1OCBfX2lvbWVtICphZGRyKQoreworCXJldHVybiByZWFkYihhZGRyKTsKK30KKworc3RhdGljIGludCBkaXNhYmxlX21zaV9yZXNldF9pcnEoc3RydWN0IGF6eCAqY2hpcCkKK3sKKwlpbnQgZXJyOworCisJZnJlZV9pcnEoY2hpcC0+aXJxLCBjaGlwKTsKKwljaGlwLT5pcnEgPSAtMTsKKwlwY2lfZGlzYWJsZV9tc2koY2hpcC0+cGNpKTsKKwljaGlwLT5tc2kgPSAwOworCWVyciA9IGF6eF9hY3F1aXJlX2lycShjaGlwLCAxKTsKKwlpZiAoZXJyIDwgMCkKKwkJcmV0dXJuIGVycjsKKworCXJldHVybiAwOworfQorCisvKiBETUEgcGFnZSBhbGxvY2F0aW9uIGhlbHBlcnMuICAqLworc3RhdGljIGludCBkbWFfYWxsb2NfcGFnZXMoc3RydWN0IGF6eCAqY2hpcCwKKwkJCSAgIGludCB0eXBlLAorCQkJICAgc2l6ZV90IHNpemUsCisJCQkgICBzdHJ1Y3Qgc25kX2RtYV9idWZmZXIg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TG9vayBmb3IgaGludCBzdHJpbmcKKyAqLworY29uc3QgY2hhciAqc25kX2hkYV9nZXRfaGludChzdHJ1Y3QgaGRhX2NvZGVjICpjb2RlYywgY29uc3QgY2hhciAqa2V5KQoreworCXN0cnVjdCBoZGFfaGludCAqaGludCA9IGdldF9oaW50KGNvZGVjLCBrZXkpOworCXJldHVybiBoaW50ID8gaGludC0+dmFsIDogTlVMTDsKK30KK0VYUE9SVF9TWU1CT0xfR1BMKHNuZF9oZGFfZ2V0X2hpbnQpOworCitpbnQgc25kX2hkYV9nZXRfYm9vbF9oaW50KHN0cnVjdCBoZGFfY29kZWMgKmNvZGVjLCBjb25zdCBjaGFyICprZXkpCit7CisJY29uc3QgY2hhciAqcDsKKwlpbnQgcmV0OworCisJbXV0ZXhfbG9jaygmY29kZWMtPnVzZXJfbXV0ZXgpOworCXAgPSBzbmRfaGRhX2dldF9oaW50KGNvZGVjLCBrZXkpOworCWlmICghcCB8fCAhKnApCisJCXJldCA9IC1FTk9FTlQ7CisJZWxzZSB7CisJCXN3aXRjaCAodG91cHBlcigqcCkpIHsKKwkJY2FzZSAnVCc6IC8qIHRydWUgKi8KKwkJY2FzZSAnWSc6IC8qIHllcyAqLworCQljYXNlICcxJzoKKwkJCXJldCA9IDE7CisJCQlicmVhazsKKwkJZGVmYXVsdDoKKwkJCXJldCA9IDA7CisJCQlicmVhazsKKwkJfQorCX0KKwltdXRleF91bmxvY2soJmNvZGVjLT51c2VyX211dGV4KTsKKwlyZXR1cm4gcmV0OworfQorRVhQT1JUX1NZTUJPTF9HUEwoc25kX2hkYV9nZXRfYm9vbF9oaW50KTsKKworaW50IHNuZF9oZGFfZ2V0X2ludF9oaW50KHN0cnVjdCBoZGFfY29kZWMgKmNvZGVjLCBjb25zdCBjaGFyICprZXksIGludCAqdmFscCkKK3sKKwljb25zdCBjaGFyICpwOworCXVuc2lnbmVkIGxvbmcgdmFsOworCWludCByZXQ7CisKKwltdXRleF9sb2NrKCZjb2RlYy0+dXNl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ICJwcm9ncmFtIGRtYWM6IGFkZHIgPSAweCV4LCBwYWRkciA9IDB4JXhcbiIsCisJZGV2X2RiZyhzb25pYy0+Y2FyZC0+ZGV2LCAicHJvZ3JhbSBkbWFjOiBhZGRyID0gMHgleCwgcGFkZHIgPSAweCV4XG4iLAogCSAgICAgICBhZGRyLCBpbmwoc29uaWMtPmRtYWNfcG9ydCArIFNWX0RNQV9BRERSMCkpOwogI2VuZGlmCiB9CkBAIC0zNTcsMTA1ICszNTcsMTA1IEBACiAjaWYgMAogc3RhdGljIHZvaWQgc25kX3NvbmljdmliZXNfZGVidWcoc3RydWN0IHNvbmljdmliZXMgKiBzb25pYykKIHsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiU1YgUkVHUzogICAgICAgICAgSU5ERVggPSAweCUwMnggICIsIGluYihTVl9SRUcoc29uaWMsIElOREVYKSkpOwotCXByaW50aygiICAgICAgICAgICAgICAgICBTVEFUVVMgPSAweCUwMnhcbiIsIGluYihTVl9SRUcoc29uaWMsIFNUQVRVUykpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAwOiBsZWZ0IGlucHV0ICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDAwKSk7Ci0JcHJpbnRrKCIgIDB4MjA6IHN5bnRoIHJhdGUgbG93ICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjApKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAxOiByaWdodCBpbnB1dCAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDAxKSk7Ci0JcHJpbnRrKCIgIDB4MjE6IHN5bnRoIHJhdGUgaGlnaCA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjEpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDAy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vbmljdmliZXNfaW4oc29uaWMsIDB4MjYpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDA3OiByaWdodCBsaW5lICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDA3KSk7Ci0JcHJpbnRrKCIgIDB4Mjc6IFN5bnRoIHBsbCBOICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjcpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDA4OiBNSUMgICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDA4KSk7Ci0JcHJpbnRrKCIgIDB4Mjg6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjgpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDA5OiBHYW1lIHBvcnQgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDA5KSk7Ci0JcHJpbnRrKCIgIDB4Mjk6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MjkpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDBhOiBsZWZ0IHN5bnRoICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDBhKSk7Ci0JcHJpbnRrKCIgIDB4MmE6IE1QVTQwMSAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MmEpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDBiOiByaWdodCBzeW50aCAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDBiKSk7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faW4oc29uaWMsIDB4MzQpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE1OiByZXZpc2lvbiAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE1KSk7Ci0JcHJpbnRrKCIgIDB4MzU6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzUpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE2OiBBREMgb3V0cHV0IGN0cmwgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE2KSk7Ci0JcHJpbnRrKCIgIDB4MzY6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzYpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE3OiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE3KSk7Ci0JcHJpbnRrKCIgIDB4Mzc6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzcpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE4OiBETUEgQSB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE4KSk7Ci0JcHJpbnRrKCIgIDB4Mzg6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzgpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDE5OiBETUEgQSBsb3dlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDE5KSk7Ci0JcHJpbnRrKCIgIDB4Mzk6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4MzkpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFhOiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFhKSk7Ci0JcHJpbnRrKCIgIDB4M2E6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2EpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFiOiAtLS0gICAgICAgICAgICAgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFiKSk7Ci0JcHJpbnRrKCIgIDB4M2I6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2IpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFjOiBETUEgQyB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFjKSk7Ci0JcHJpbnRrKCIgIDB4M2M6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2MpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFkOiBETUEgQyB1cHBlciBjbnQgPSAweCUwMnggICIsIHNuZF9zb25pY3ZpYmVzX2luKHNvbmljLCAweDFkKSk7Ci0JcHJpbnRrKCIgIDB4M2Q6IC0tLSAgICAgICAgICAgICA9IDB4JTAyeFxuIiwgc25kX3NvbmljdmliZXNfaW4oc29uaWMsIDB4M2QpKTsKLQlwcmludGsoS0VSTl9ERUJVRwotCSAgICAgICAiICAweDFlOiBQQ00gcmF0ZSBsb3cgICA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worfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX2luaXRfZ2VuMShzdHJ1Y3QgcnNuZF9tb2QgKm1vZCwKKwkJCSAgICAgIHN0cnVjdCByc25kX2RhaSAqcmRhaSwKKwkJCSAgICAgIHN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCWludCByZXQ7CisKKwlyZXQgPSByc25kX3NyY19pbml0KG1vZCwgcmRhaSwgaW8pOworCWlmIChyZXQgPCAwKQorCQlyZXR1cm4gcmV0OworCisJcmV0ID0gcnNuZF9zcmNfc2V0X3JvdXRlX2dlbjEobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF9yYXRlX2dlbjEobW9kLCByZGFpLCBpbyk7CisJaWYgKHJldCA8IDApCisJCXJldHVybiByZXQ7CisKKwlyZXQgPSByc25kX3NyY19zZXRfY29udmVydF90aW1pbmdfZ2VuMShtb2QsIHJkYWksIGlvKTsKKwlpZiAocmV0IDwgMCkKKwkJcmV0dXJuIHJldDsKKworCXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHJzbmRfc3JjX3N0YXJ0X2dlbjEoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICAgc3RydWN0IHJzbmRfZGFpICpyZGFpLAorCQkJICAgICAgIHN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCWludCBpZCA9IHJzbmRfbW9kX2lkKG1vZCk7CisKKwlyc25kX21vZF9ic2V0KG1vZCwgU1JDX1JPVVRFX0NUUkwsICgxIDw8IGlkKSwgKDEgPDwgaWQpKTsKKworCXJldHVybiByc25kX3NyY19zdGFydChtb2QsIHJkYWksIGlvKTsKK30KKworc3RhdGljIGludCByc25kX3NyY19zdG9wX2dlbjEoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICBzdHJ1Y3QgcnNuZF9kYWkgKnJkYWksCisJCQkgICAgICBzdHJ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X3RvX2luZm8ocHJpdik7CisJc3RydWN0IHJzbmRfc3JjICpzcmMgPSByc25kX21vZF90b19zcmMobW9kKTsKKwlzdHJ1Y3QgcnNuZF9tb2QgKnNzaSA9IHJzbmRfc3NpX21vZF9nZXQocHJpdiwgcnNuZF9tb2RfaWQobW9kKSk7CisJc3RydWN0IGRldmljZSAqZGV2ID0gcnNuZF9wcml2X3RvX2Rldihwcml2KTsKKwlpbnQgcmV0OworCWludCBpc19wbGF5OworCisJaWYgKGluZm8tPmRhaV9pbmZvKQorCQlpc19wbGF5ID0gcnNuZF9pbmZvX2lzX3BsYXliYWNrKHByaXYsIHNyYyk7CisJZWxzZQorCQlpc19wbGF5ID0gcnNuZF9zc2lfaXNfcGxheShzc2kpOworCisJcmV0ID0gcnNuZF9kbWFfaW5pdChwcml2LAorCQkJICAgIHJzbmRfbW9kX3RvX2RtYShtb2QpLAorCQkJICAgIGlzX3BsYXksCisJCQkgICAgc3JjLT5pbmZvLT5kbWFfaWQpOworCWlmIChyZXQgPCAwKQorCQlkZXZfZXJyKGRldiwgIlNSQyBETUEgZmFpbGVkXG4iKTsKKworCXJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQgcnNuZF9zcmNfcmVtb3ZlX2dlbjIoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkJc3RydWN0IHJzbmRfZGFpICpyZGFpLAorCQkJCXN0cnVjdCByc25kX2RhaV9zdHJlYW0gKmlvKQoreworCXJzbmRfZG1hX3F1aXQocnNuZF9tb2RfdG9fcHJpdihtb2QpLCByc25kX21vZF90b19kbWEobW9kKSk7CisKKwlyZXR1cm4gMDsKK30KKworc3RhdGljIGludCByc25kX3NyY19pbml0X2dlbjIoc3RydWN0IHJzbmRfbW9kICptb2QsCisJCQkgICAgICBzdHJ1Y3QgcnNuZF9kYWkgKnJkYWksCisJCQkgICAgICBzdHJ1Y3QgcnNuZF9kYWlfc3RyZWFtICppbykKK3sKKwlpbnQgcmV0OworCisJcmV0ID0gcnN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