Date: Fri, 6 Mar 2015 18:38:04 +0100 From: Svatopluk Kraus <onwahe@gmail.com> To: freebsd-arm@freebsd.org Subject: Re: interrupt framework Message-ID: <CAFHCsPUkcTyEhj7NhmsWtJ7hht8PNAnHnwMPbbjH_SDWJMm0KQ@mail.gmail.com> In-Reply-To: <CAFHCsPVhRnRXhLF6S-%2BDL5mM22X0CkMmKOkkuo0DOMShkEM=fQ@mail.gmail.com> References: <CAFHCsPX5kG_v-F-cjpyMQsT_b386eok=mqWW0%2BEUb_4-_1Otnw@mail.gmail.com> <CAFHCsPVhRnRXhLF6S-%2BDL5mM22X0CkMmKOkkuo0DOMShkEM=fQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=UTF-8 Hi, I have finished work on new interrupt framework. The state is reflected in intrng_full_01.diff. ARM_INTRNG define is used in all files so old and new framework can live together until all controllers will be reworked. I have reworked GIC controller and tested it on panda. I have reworked AINTC controller and tested it on BBB. As more platforms use these controllers, I use ARM_INTRNG define as well. The codes are not clean up yet. The patches are intrng_gic_panda.diff and intrng_aintc_01.diff. I have rework TI_GPIO controller and tested it on panda and BBB. Only panda and BBB use this code so ARM_INTRNG is not used. The patch is intrng_ti_gpio_panda_bbb_01.diff. The code is not clean up yet too and moreover there is test module left in diff. For panda, gpio_113 button is printing some message. For BBB, pin 12 on P9 interface is doing same. I have reworked and tested controller for RPI-B, however I want to rework its gpio controller before I will present it. As we must decribe interrupts by controller name (due to cascaded controllers), system tools and MI interrupt code does not work well with now longer decriptions. The interrupt.h.diff could help a little bit. I would appreciate more testing of GIC on platforms I haven't got. And some feedback would be nice too. Svatopluk Kraus --20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=US-ASCII; name="intrng_full_01.diff" Content-Disposition: attachment; filename="intrng_full_01.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i6xu3gw53 SW5kZXg6IHN5cy9hcm0vYXJtL2ludHJuZy5jCj09PT09P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YXMgcHJvdmVuIHRoYXQKKwkgKiAgICAgICBmb3IgdGltZXIgUFBJIGludGVycnVwdHMgdGhl IGxvc3QgaXMgbWVhc3VyYWJsZSBlYXNpbHkuCisJICovCisJaXNyYy0+aXNyY19jb3VudFswXSsr OworCS8qYXRvbWljX2FkZF9sb25nKCZpc3JjLT5pc3JjX2NvdW50WzBdLCAxKTsqLworfQorCisv KgorICogIFZpcnR1YWxpemF0aW9uIGZvciBpbnRlcnJ1cHQgc291cmNlIGludGVycnVwdCBzdHJh eSBjb3VudGVyIGluY3JlbWVudC4KKyAqLworc3RhdGljIGlubGluZSB2b2lkCitpc3JjX2luY3Jl bWVudF9zdHJheWNvdW50KHN0cnVjdCBhcm1faXJxc3JjICppc3JjKQoreworCisJaXNyYy0+aXNy Y19jb3VudFsxXSsrOworfQorCisvKgorICogIFZpcnR1YWxpemF0aW9uIGZvciBpbnRlcnJ1cHQg c291cmNlIGludGVycnVwdCBuYW1lIHVwZGF0ZS4KKyAqLworc3RhdGljIHZvaWQKK2lzcmNfdXBk YXRlX25hbWUoc3RydWN0IGFybV9pcnFzcmMgKmlzcmMsIGNvbnN0IGNoYXIgKm5hbWUpCit7CisJ Y2hhciBzdHJbSU5UUk5BTUVfTEVOXTsKKworCW10eF9hc3NlcnQoJmlzcmNfdGFibGVfbG9jaywg TUFfT1dORUQpOworCisJaWYgKG5hbWUgIT0gTlVMTCkgeworCQlzbnByaW50ZihzdHIsIElOVFJO QU1FX0xFTiwgIiVzOiAlcyIsIGlzcmMtPmlzcmNfbmFtZSwgbmFtZSk7CisJCWludHJjbnRfc2V0 bmFtZShzdHIsIGlzcmMtPmlzcmNfaW5kZXgpOworCQlzbnByaW50ZihzdHIsIElOVFJOQU1FX0xF TiwgInN0cmF5ICVzOiAlcyIsIGlzcmMtPmlzcmNfbmFtZSwKKwkJICAgIG5hbWUpOworCQlpbnRy Y250X3NldG5hbWUoc3RyLCBpc3JjLT5pc3JjX2luZGV4ICsgMSk7CisJfSBlbHNlIHsKKwkJc25w cmludGYoc3RyLCBJTlRSTkFNRV9MRU4sICIlczoiLCBpc3JjLT5pc3JjX25hbWUpOworCQlpbnRy Y250X3NldG5hbWUoc3RyLCBpc3JjLT5pc3JjX2luZGV4KTsKKwkJc25wcmludGYoc3RyLCBJTlRS TkFNRV9MRU4sICJzdHJheSAlczoiLCBpc3JjLT5pc3JjX25hbWUpOworCQlpbnRyY250X3NldG5h bWUoc3RyLCBpc3JjLT5pc3JjX2luZGV4ICsgMSk7CisJfQorfQorCisvKgorICogIFZpcnR1YWxp emF0aW9uIGZvciBpbnRlcnJ1cHQgc291cmNlIGludGVycnVwdCBjb3VudGVycyBzZXR1cC4KKyAq Lworc3RhdGljIHZvaWQKK2lzcmNfc2V0dXBfY291bnRlcnMoc3RydWN0IGFybV9pcnFzcmMgKmlz cmMpCit7CisJdV9pbnQgaW5kZXg7CisKKwkvKgorCSAqICBYWFggLSBpdCBkb2VzIG5vdCB3b3Jr IHdlbGwgd2l0aCByZW1vdmFibGUgY29udHJvbGxlcnMgYW5kCisJICogICAgICAgIGludGVycnVw dCBzb3VyY2VzICEhIQorCSAqLworCWluZGV4ID0gYXRvbWljX2ZldGNoYWRkX2ludCgmaW50cmNu dF9pbmRleCwgMik7CisJaXNyYy0+aXNyY19pbmRleCA9IGluZGV4OworCWlzcmMtPmlzcmNfY291 bnQgPSAmaW50cmNudFtpbmRleF07CisJaXNyY191cGRhdGVfbmFtZShpc3JjLCBOVUxMKTsKK30K KworI2lmZGVmIFNNUAorLyoKKyAqICBWaXJ0dWFsaXphdGlvbiBmb3IgaW50ZXJydXB0IHNvdXJj ZSBJUEkgY291bnRlciBpbmNyZW1lbnQuCisgKi8KK3N0YXRpYyBpbmxpbmUgdm9pZAoraXNyY19p bmNyZW1lbnRfaXBpX2NvdW50KHN0cnVjdCBhcm1faXJxc3JjICppc3JjLCB1X2ludCBjcHUpCit7 CisKKwlpc3JjLT5pc3JjX2NvdW50W2NwdV0rKzsKK30KKworLyoKKyAq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NlLgorICovCit1X2ludAorYXJtX2ZkdF9tYXBfaXJxKHBoYW5kbGVf dCBub2RlLCBwY2VsbF90ICpjZWxscywgdV9pbnQgbmNlbGxzKQoreworCXN0cnVjdCBhcm1faXJx c3JjICppc3JjLCAqbmV3X2lzcmM7CisJdV9pbnQgY2VsbHNpemU7CisJaW50cHRyX3QgeHJlZjsK KwlpbnQgZXJyb3I7CisKKwl4cmVmID0gKGludHB0cl90KW5vZGU7CS8qIEl0J3Mgc28gc2ltcGxl IGZvciBub3cuICovCisKKwljZWxsc2l6ZSA9IG5jZWxscyAqIHNpemVvZigqY2VsbHMpOworCW5l d19pc3JjID0gaXNyY19hbGxvYyhBUk1fSVNSQ1RfRkRULCBjZWxsc2l6ZSk7CisKKwltdHhfbG9j aygmaXNyY190YWJsZV9sb2NrKTsKKwlpc3JjID0gaXNyY19mZHRfbG9va3VwKHhyZWYsIGNlbGxz LCBuY2VsbHMpOworCWlmIChpc3JjICE9IE5VTEwpIHsKKwkJbXR4X3VubG9jaygmaXNyY190YWJs ZV9sb2NrKTsKKwkJaXNyY19mcmVlKG5ld19pc3JjKTsKKwkJcmV0dXJuIChpc3JjLT5pc3JjX2ly cSk7CS8qIGFscmVhZHkgbWFwcGVkICovCisJfQorCisJZXJyb3IgPSBpc3JjX2FsbG9jX2lycV9s b2NrZWQobmV3X2lzcmMpOworCWlmIChlcnJvciAhPSAwKSB7CisJCW10eF91bmxvY2soJmlzcmNf dGFibGVfbG9jayk7CisJCWlzcmNfZnJlZShuZXdfaXNyYyk7CisJCXJldHVybiAoSVJRX0lOVkFM SUQpOwkJLyogbm8gc3BhY2UgbGVmdCAqLworCX0KKworCW5ld19pc3JjLT5pc3JjX3hyZWYgPSB4 cmVmOworCW5ld19pc3JjLT5pc3JjX25jZWxscyA9IG5jZWxsczsKKwltZW1jcHkobmV3X2lzcmMt PmlzcmNfY2VsbHMsIGNlbGxzLCBjZWxsc2l6ZSk7CisJbXR4X3VubG9jaygmaXNyY190YWJsZV9s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TElTVF9GT1JFQUNIKHBpYywgJnBpY19saXN0LCBwaWNfbmV4dCkgeworCQlpZiAocGljLT5w aWNfeHJlZiAhPSB4cmVmKQorCQkJY29udGludWU7CisJCWlmIChwaWMtPnBpY194cmVmICE9IDAg fHwgcGljLT5waWNfZGV2ID09IGRldikKKwkJCXJldHVybiAocGljKTsKKwl9CisJcmV0dXJuIChO VUxMKTsKK30KKworLyoKKyAqICBMb29rdXAgaW50ZXJydXB0IGNvbnRyb2xsZXIuCisgKi8KK3N0 YXRpYyBzdHJ1Y3QgYXJtX3BpYyAqCitwaWNfbG9va3VwKGRldmljZV90IGRldiwgaW50cHRyX3Qg eHJlZikKK3sKKwlzdHJ1Y3QgYXJtX3BpYyAqcGljOworCisJbXR4X2xvY2soJnBpY19saXN0X2xv Y2spOworCXBpYyA9IHBpY19sb29rdXBfbG9ja2VkKGRldiwgeHJlZik7CisJbXR4X3VubG9jaygm cGljX2xpc3RfbG9jayk7CisKKwlyZXR1cm4gKHBpYyk7Cit9CisKKy8qCisgKiAgQ3JlYXRlIGlu dGVycnVwdCBjb250cm9sbGVyLgorICovCitzdGF0aWMgc3RydWN0IGFybV9waWMgKgorcGljX2Ny ZWF0ZShkZXZpY2VfdCBkZXYsIGludHB0cl90IHhyZWYpCit7CisJc3RydWN0IGFybV9waWMgKnBp YzsKKworCW10eF9sb2NrKCZwaWNfbGlzdF9sb2NrKTsKKwlwaWMgPSBwaWNfbG9va3VwX2xvY2tl ZChkZXYsIHhyZWYpOworCWlmIChwaWMgIT0gTlVMTCkgeworCQltdHhfdW5sb2NrKCZwaWNfbGlz dF9sb2NrKTsKKwkJcmV0dXJuIChwaWMpOworCX0KKwlwaWMgPSBtYWxsb2Moc2l6ZW9mKCpwaWMp LCBNX0lOVFJORywgTV9OT1dBSVQgfCBNX1pFUk8pOworCXBpYy0+cGljX3hyZWYgPSB4cmVmOwor CXBpYy0+cGljX2RldiA9IGRldjsKKwlTTElTVF9JTlNFUlRfSEVBRCgmcGljX2xpc3QsIHBpYywg cGljX25leHQpOworCW10eF91bmxvY2soJnBpY19saXN0X2xvY2spOworCisJcmV0dXJuIChwaWMp OworfQorI2lmZGVmIG5vdHlldAorLyoKKyAqICBEZXN0cm95IGludGVycnVwdCBjb250cm9sbGVy LgorICovCitzdGF0aWMgdm9pZAorcGljX2Rlc3Ryb3koZGV2aWNlX3QgZGV2LCBpbnRwdHJfdCB4 cmVmKQoreworCXN0cnVjdCBhcm1fcGljICpwaWM7CisKKwltdHhfbG9jaygmcGljX2xpc3RfbG9j ayk7CisJcGljID0gcGljX2xvb2t1cF9sb2NrZWQoZGV2LCB4cmVmKTsKKwlpZiAocGljID09IE5V TEwpIHsKKwkJbXR4X3VubG9jaygmcGljX2xpc3RfbG9jayk7CisJCXJldHVybjsKKwl9CisJU0xJ U1RfUkVNT1ZFKCZwaWNfbGlzdCwgcGljLCBhcm1fcGljLCBwaWNfbmV4dCk7CisJbXR4X3VubG9j aygmcGljX2xpc3RfbG9jayk7CisKKwlmcmVlKHBpYywgTV9JTlRSTkcpOworfQorI2VuZGlmCisv KgorICogIFJlZ2lzdGVyIGludGVycnVwdCBjb250cm9sbGVyLgorICovCitpbnQKK2FybV9waWNf cmVnaXN0ZXIoZGV2aWNlX3QgZGV2LCBpbnRwdHJfdCB4cmVmKQoreworCXN0cnVjdCBhcm1fcGlj ICpwaWM7CisKKwlwaWMgPSBwaWNfY3JlYXRlKGRldiwgeHJlZik7CisJaWYgKHBpYyA9PSBOVUxM KQorCQlyZXR1cm4gKEVOT01FTSk7CisJaWYgKHBpYy0+cGljX2RldiAhPSBkZXYpCisJCXJldHVy biAoRUlOVkFMKTsJLyogWFhYIGl0IGNvdWxkIGJlIG1hbnkgdGhpbmdzLiAqLworCisJZGVidWdm KCJQSUMgJXAgcmVnaXN0ZXJlZCBmb3IgJXMgPHhyZWYgJXg+XG4iLCBwaWMsCisJICAgIGRldmlj ZV9nZXRfbmFtZXVuaXQoZGV2KSwgeHJlZik7CisJcmV0dXJuICgwKTsKK30KKworLyoKKyAqICBV bnJlZ2lzdGVyIGludGVycnVwdCBjb250cm9sbGVyLgorICovCitpbnQKK2FybV9waWNfdW5yZWdp c3RlcihkZXZpY2VfdCBkZXYsIGludHB0cl90IHhyZWYpCit7CisKKwlwYW5pYygiJXM6IG5vdCBp bXBsZW1lbnRlZCIsIF9fZnVuY19fKTsKK30KKworLyoKKyAqICBNYXJrIGludGVycnVwdCBjb250 cm9sbGVyIChpdHNlbGYpIGFzIGEgcm9vdCBvbmUuCisgKgorICogIE5vdGUgdGhhdCBvbmx5IGFu IGludGVycnVwdCBjb250cm9sbGVyIGNhbiByZWFsbHkga25vdyBpdHMgcG9zaXRpb24KKyAqICBp biBpbnRlcnJ1cHQgY29udHJvbGxlcidzIHRyZWUuIFNvIHJvb3QgUElDIG11c3QgY2xhaW0gaXRz ZWxmIGFzIGEgcm9vdC4KKyAqCisgKiAgSW4gRkRUIGNhc2UsIGFjY29yZGluZyB0byBlUEFQUiBh cHByb3ZlZCB2ZXJzaW9uIDEuMSBmcm9tIDA4IEFwcmlsIDIwMTEsCisgKiAgcGFnZSAzMDoKKyAq ICAgICJUaGUgcm9vdCBvZiB0aGUgaW50ZXJydXB0IHRyZWUgaXMgZGV0ZXJtaW5lZCB3aGVuIHRy YXZlcnNhbAorICogICAgIG9mIHRoZSBpbnRlcnJ1cHQgdHJlZSByZWFjaGVzIGFuIGludGVycnVw dCBjb250cm9sbGVyIG5vZGUgd2l0aG91dAorICogICAgIGFuIGludGVycnVwdHMgcHJvcGVydHkg YW5kIHRodXMgbm8gZXhwbGljaXQgaW50ZXJydXB0IHBhcmVudC4iCisgKi8KK2ludAorYXJtX3Bp Y19jbGFpbV9yb290KGRldmljZV90IGRldiwgaW50cHRyX3QgeHJlZiwgYXJtX2lycV9maWx0ZXJf dCAqZmlsdGVyLAorICAgIHZvaWQgKmFyZywgdV9pbnQgaXBpY291bnQpCit7CisKKwlpZiAocGlj X2xvb2t1cChkZXYsIHhyZWYpID09IE5V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PSBpc3JjX2xvb2t1 cChpcnEpOworCWlmIChpc3JjID09IE5VTEwgfHwgaXNyYy0+aXNyY19oYW5kbGVycyA9PSAwKQor CQlyZXR1cm4gKEVJTlZBTCk7CisKKwlpZiAoaXNyYy0+aXNyY19maWx0ZXIgIT0gTlVMTCkgewor CQlpZiAoaXNyYyAhPSBjb29raWUpCisJCQlyZXR1cm4gKEVJTlZBTCk7CisKKwkJbXR4X2xvY2so JmlzcmNfdGFibGVfbG9jayk7CisJCWlzcmNfdXBkYXRlX25hbWUoaXNyYywgZGVzY3IpOworCQlt dHhfdW5sb2NrKCZpc3JjX3RhYmxlX2xvY2spOworCQlyZXR1cm4gKDApOworCX0KKworCWVycm9y ID0gaW50cl9ldmVudF9kZXNjcmliZV9oYW5kbGVyKGlzcmMtPmlzcmNfZXZlbnQsIGNvb2tpZSwg ZGVzY3IpOworCWlmIChlcnJvciA9PSAwKSB7CisJCW10eF9sb2NrKCZpc3JjX3RhYmxlX2xvY2sp OworCQlpbnRyY250X3VwZGF0ZW5hbWUoaXNyYyk7CisJCW10eF91bmxvY2soJmlzcmNfdGFibGVf bG9jayk7CisJfQorCXJldHVybiAoZXJyb3IpOworfQorCisjaWZkZWYgU01QCitpbnQKK2FybV9p cnFfYmluZCh1X2ludCBpcnEsIGludCBjcHUpCit7CisJc3RydWN0IGFybV9pcnFzcmMgKmlzcmM7 CisKKwlpc3JjID0gaXNyY19sb29rdXAoaXJxKTsKKwlpZiAoaXNyYyA9PSBOVUxMIHx8IGlzcmMt PmlzcmNfaGFuZGxlcnMgPT0gMCkKKwkJcmV0dXJuIChFSU5WQUwpOworCisJaWYgKGlzcmMtPmlz cmNfZmlsdGVyICE9IE5VTEwpCisJCXJldHVybiAoYXJtX2lzcmNfYXNzaWduX2NwdShpc3JjLCBj cHUpKTsKKworCXJldHVybiAoaW50cl9ldmVudF9iaW5kKGlzcmMtPmlzcmNfZXZlbnQsIGNwdSkp OworfQorCisvKgorICogUmV0dXJuIHRoZSBDUFU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WlkKSk7 Cit9CisjZW5kaWYKKworI2lmZGVmIEZEVAorLyoKKyAqICBEZXNjcmliZSBpbnRlcnJ1cHQgc291 cmNlIGZvciBGRFQuCisgKi8KK2ludAorZmR0X2Rlc2NyaWJlX2lycShjaGFyICpidWYsIHVfaW50 IGxlbiwgdV9pbnQgaXJxKQoreworCXN0cnVjdCBhcm1faXJxc3JjICppc3JjOworCWludCBydjsK KworCWlzcmMgPSBpc3JjX2xvb2t1cChpcnEpOworCWlmIChpc3JjID09IE5VTEwpIHsKKwkJcmV0 dXJuIChzbnByaW50ZihidWYsIGxlbiwgIm5vIGlycSBzb3VyY2UiKSk7CisJfQorCisJKHZvaWQp aXNyY19yZWdpc3Rlcihpc3JjKTsKKwlpZiAoKGlzcmMtPmlzcmNfZmxhZ3MgJiBJU1JDRl9SRUdJ U1RFUkVEKSA9PSAwKSB7CisJCXJ2ID0gc25wcmludGYoYnVmLCBsZW4sICJpcnEldShub3QgbWFw cGVkKSIsIGlycSk7CisJfSBlbHNlIHsKKwkJcnYgPSBzbnByaW50ZihidWYsIGxlbiwgImlycSV1 KCVzKSIsIGlycSwgaXNyYy0+aXNyY19uYW1lKTsKKwl9CisJcmV0dXJuIChydik7Cit9CisjZW5k aWYKKwordm9pZCBkb3NvZnRpbnRzKHZvaWQpOwordm9pZAorZG9zb2Z0aW50cyh2b2lkKQorewor fQorCisvKgorICogYXJtX2lycV9tZW1vcnlfYmFycmllcigpCisgKgorICogRW5zdXJlIGFsbCB3 cml0ZXMgdG8gZGV2aWNlIG1lbW9yeSBoYXZlIHJlYWNoZWQgZGV2aWNlcyBiZWZvcmUgcHJvY2Vl ZGluZy4KKyAqCisgKiBUaGlzIGlzIGludGVuZGVkIHRvIGJlIGNhbGxlZCBmcm9tIHRoZSBwb3N0 LWZpbHRlciBhbmQgcG9zdC10aHJlYWQgcm91dGluZXMKKyAqIG9mIGFuIGludGVycnVwdCBjb250 cm9sbGVyIGltcGxlbWVudGF0aW9uLiAgQSBwZXJpc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FyZyAhPSBOVUxMID8gaXNyYy0+aXNyY19hcmcgOiB0 ZjsKKwlpc3JjLT5pc3JjX2lwaWZpbHRlcihhcmcpOworfQorCisvKgorICogIE1hcCBJUEkgaW50 byBpbnRlcnJ1cHQgY29udHJvbGxlci4KKyAqCisgKiAgTm90IFNNUCBjb2hlcmVudC4KKyAqLwor c3RhdGljIGludAoraXBpX21hcChzdHJ1Y3QgYXJtX2lycXNyYyAqaXNyYywgdV9pbnQgaXBpKQor eworCWJvb2xlYW5fdCBpc19wZXJjcHU7CisJaW50IGVycm9yOworCisJaWYgKGlwaSA+PSBBUk1f SVBJX0NPVU5UKQorCQlwYW5pYygiJXM6IG5vIHN1Y2ggSVBJICV1IiwgX19mdW5jX18sIGlwaSk7 CisKKwlLQVNTRVJUKGlycV9yb290X2RldiAhPSBOVUxMLCAoIiVzOiBubyByb290IGF0dGFjaGVk IiwgX19mdW5jX18pKTsKKworCWlzcmMtPmlzcmNfdHlwZSA9IEFSTV9JU1JDVF9OQU1FU1BBQ0U7 CisJaXNyYy0+aXNyY19uc3BjX3R5cGUgPSBBUk1fSVJRX05TUENfSVBJOworCWlzcmMtPmlzcmNf bnNwY19udW0gPSBpcGlfbmV4dF9udW07CisKKwllcnJvciA9IFBJQ19SRUdJU1RFUihpcnFfcm9v dF9kZXYsIGlzcmMsICZpc19wZXJjcHUpOworCisJZGVidWdmKCJpcGkgJXUgbWFwcGVkIHRvICV1 IG9uICVzIC0gZXJyb3IgJWRcbiIsIGlwaSwgaXBpX25leHRfbnVtLAorCSAgICBkZXZpY2VfZ2V0 X25hbWV1bml0KGlycV9yb290X2RldiksIGVycm9yKTsKKworCWlmIChlcnJvciA9PSAwKQorCQlp cGlfbmV4dF9udW0rKzsKKwlyZXR1cm4gKGVycm9yKTsKK30KKworLyoKKyAqICBTZXR1cCBJUEkg aGFuZGxlciB0byBpbnRlcnJ1cHQgc291cmNlLgorICoKKyAqICBOb3RlIHRoYXQgdGhlcmUgY291 bGQgYmUgbW9y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NfaXBpX3NlbmQoY3B1c2V0X3Qg Y3B1cywgdV9pbnQgaXBpKQoreworCXN0cnVjdCBhcm1faXJxc3JjICppc3JjOworCisJaXNyYyA9 IGFybV9pcGlfbG9va3VwKGlwaSk7CisKKwlLQVNTRVJUKGlycV9yb290X2RldiAhPSBOVUxMLCAo IiVzOiBubyByb290IGF0dGFjaGVkIiwgX19mdW5jX18pKTsKKwlQSUNfSVBJX1NFTkQoaXJxX3Jv b3RfZGV2LCBpc3JjLCBjcHVzKTsKK30KKworLyoKKyAqICBJbml0IGludGVycnVwdCBjb250cm9s bGVyIG9uIGFub3RoZXIgQ1BVLgorICovCit2b2lkCithcm1fcGljX2luaXRfc2Vjb25kYXJ5KHZv aWQpCit7CisKKwkvKgorCSAqIFFRUTogT25seSByb290IFBJQyBpcyBhd2FyZSBvZiBvdGhlciBD UFVzID8/PworCSAqLworCUtBU1NFUlQoaXJxX3Jvb3RfZGV2ICE9IE5VTEwsICgiJXM6IG5vIHJv b3QgYXR0YWNoZWQiLCBfX2Z1bmNfXykpOworCisJbXR4X2xvY2soJmlzcmNfdGFibGVfbG9jayk7 CisJUElDX0lOSVRfU0VDT05EQVJZKGlycV9yb290X2Rldik7CisJbXR4X3VubG9jaygmaXNyY190 YWJsZV9sb2NrKTsKK30KKyNlbmRpZgorCisjaWZkZWYgRERCCitEQl9TSE9XX0NPTU1BTkQoaXJx LCBkYl9zaG93X2lycSkKK3sKKwl1X2ludCBpLCBpcnFzdW07CisJc3RydWN0IGFybV9pcnFzcmMg KmlzcmM7CisKKyNpZmRlZiBTTVAKKwlmb3IgKGkgPSAwOyBpIDw9IG1wX21heGlkOyBpKyspIHsK KwkJc3RydWN0IHBjcHUgKnBjOworCQl1X2ludCBpcGksIGlwaXN1bTsKKworCQlwYyA9IHBjcHVf ZmluZChpKTsKKwkJaWYgKHBjICE9IE5VTEwpIHsKKwkJCWZvciAoaXBpc3VtID0gMCwgaXBpID0g MDsgaXBpIDwgQVJNX0lQSV9DT1VOVDsgaXBpKyspIHsKKwkJCQlpc3JjID0gYXJtX2lwaV9sb29r dXAoaXBpKTsKKwkJCQlpZiAoaXNyYy0+aXNyY19jb3VudCAhPSBOVUxMKQorCQkJCQlpcGlzdW0g Kz0gaXNyYy0+aXNyY19jb3VudFtpXTsKKwkJCX0KKwkJCXByaW50ZiAoImNwdSV1OiB0b3RhbCAl dSBpcGlzICV1XG4iLCBpLAorCQkJICAgIHBjLT5wY19jbnQudl9pbnRyLCBpcGlzdW0pOworICAg IAkJfQorCX0KKwlkYl9wcmludGYoIlxuIik7CisjZW5kaWYKKworCWZvciAoaXJxc3VtID0gMCwg aSA9IDA7IGkgPCBOSVJROyBpKyspIHsKKwkJaXNyYyA9IGlycV9zb3VyY2VzW2ldOworCQlpZiAo aXNyYyA9PSBOVUxMKQorCQkJY29udGludWU7CisKKwkJZGJfcHJpbnRmKCJpcnElLTN1IDwlcz46 IGNwdSAlMDJseCVzIGNudCAlbHVcbiIsIGksCisJCSAgICBpc3JjLT5pc3JjX25hbWUsIGlzcmMt PmlzcmNfY3B1Ll9fYml0c1swXSwKKwkJICAgIGlzcmMtPmlzcmNfZmxhZ3MgJiBJU1JDRl9CT1VO RCA/ICIgKGJvdW5kKSIgOiAiIiwKKwkJICAgIGlzcmMtPmlzcmNfY291bnRbMF0pOworCQlpcnFz dW0gKz0gaXNyYy0+aXNyY19jb3VudFswXTsKKwl9CisJZGJfcHJpbnRmKCJpcnEgdG90YWwgJXVc biIsIGlycXN1bSk7CisKK30KKyNlbmRpZgpJbmRleDogc3lzL2FybS9hcm0vbXBfbWFjaGRlcC5j Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT0KLS0tIHN5cy9hcm0vYXJtL21wX21hY2hkZXAuYwkocmV2aXNpb24gMjc5Njg1 KQorKysgc3lzL2FybS9hcm0vbXBfbWFjaGRlcC5jCSh3b3JraW5nIGNvcHkpCkBAIC03Myw3ICs3 My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LS0tIHN5cy9hcm0vYXJtL25leHVzLmMJKHJl dmlzaW9uIDI3OTY4NSkKKysrIHN5cy9hcm0vYXJtL25leHVzLmMJKHdvcmtpbmcgY29weSkKQEAg LTg1LDggKzg1LDEzIEBACiAgICAgdV9sb25nLCB1X2xvbmcsIHVfbG9uZywgdV9pbnQpOwogc3Rh dGljCWludCBuZXh1c19hY3RpdmF0ZV9yZXNvdXJjZShkZXZpY2VfdCwgZGV2aWNlX3QsIGludCwg aW50LAogICAgIHN0cnVjdCByZXNvdXJjZSAqKTsKKyNpZmRlZiBTTVAKK3N0YXRpYwlpbnQgbmV4 dXNfYmluZF9pbnRyKGRldmljZV90LCBkZXZpY2VfdCwgc3RydWN0IHJlc291cmNlICosIGludCk7 CisjZW5kaWYKIHN0YXRpYyBpbnQgbmV4dXNfY29uZmlnX2ludHIoZGV2aWNlX3QgZGV2LCBpbnQg aXJxLCBlbnVtIGludHJfdHJpZ2dlciB0cmlnLAogICAgIGVudW0gaW50cl9wb2xhcml0eSBwb2wp Oworc3RhdGljCWludCBuZXh1c19kZXNjcmliZV9pbnRyKGRldmljZV90IGRldiwgZGV2aWNlX3Qg Y2hpbGQsCisgICAgc3RydWN0IHJlc291cmNlICppcnEsIHZvaWQgKmNvb2tpZSwgY29uc3QgY2hh ciAqZGVzY3IpOwogc3RhdGljCWludCBuZXh1c19kZWFjdGl2YXRlX3Jlc291cmNlKGRldmljZV90 LCBkZXZpY2VfdCwgaW50LCBpbnQsCiAgICAgc3RydWN0IHJlc291cmNlICopOwogc3RhdGljIGlu dCBuZXh1c19yZWxlYXNlX3Jlc291cmNlKGRldmljZV90LCBkZXZpY2VfdCwgaW50LCBpbnQsCkBA IC0xMTUsNiArMTIwLDEyIEBACiAJREVWTUVUSE9EKGJ1c19yZWxlYXNlX3Jlc291cmNlLAluZXh1 c19yZWxlYXNlX3Jlc291cmNlKSwKIAlERVZNRVRIT0QoYnVzX3NldHVwX2ludHIsCW5leHVzX3Nl dHVwX2ludHIpLA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KmlzcmMsIHN0 cnVjdCB0cmFwZnJhbWUgKnRmKTsKKworI2RlZmluZSBBUk1fSVJRX05TUENfTk9ORQkwCisjZGVm aW5lIEFSTV9JUlFfTlNQQ19QTEFJTgkxCisjZGVmaW5lIEFSTV9JUlFfTlNQQ19JUlEJMgorI2Rl ZmluZSBBUk1fSVJRX05TUENfSVBJCTMKKwordV9pbnQgYXJtX25hbWVzcGFjZV9tYXBfaXJxKGRl dmljZV90IGRldiwgdWludDE2X3QgdHlwZSwgdWludDE2X3QgbnVtKTsKKyNpZmRlZiBGRFQKK3Vf aW50IGFybV9mZHRfbWFwX2lycShwaGFuZGxlX3QsIHBjZWxsX3QgKiwgdV9pbnQpOworI2VuZGlm CisKK2ludCBhcm1fcGljX3JlZ2lzdGVyKGRldmljZV90IGRldiwgaW50cHRyX3QgeHJlZik7Citp bnQgYXJtX3BpY191bnJlZ2lzdGVyKGRldmljZV90IGRldiwgaW50cHRyX3QgeHJlZik7CitpbnQg YXJtX3BpY19jbGFpbV9yb290KGRldmljZV90IGRldiwgaW50cHRyX3QgeHJlZiwgYXJtX2lycV9m aWx0ZXJfdCAqZmlsdGVyLAorICAgIHZvaWQgKmFyZywgdV9pbnQgaXBpY291bnQpOworCitpbnQg YXJtX2lycV9hZGRfaGFuZGxlcihkZXZpY2VfdCBkZXYsIGRyaXZlcl9maWx0ZXJfdCwgZHJpdmVy X2ludHJfdCwgdm9pZCAqLAorICAgIHVfaW50LCBpbnQsIHZvaWQgKiopOworaW50IGFybV9pcnFf cmVtb3ZlX2hhbmRsZXIoZGV2aWNlX3QgZGV2LCB1X2ludCwgdm9pZCAqKTsKK2ludCBhcm1faXJx X2NvbmZpZyh1X2ludCwgZW51bSBpbnRyX3RyaWdnZXIsIGVudW0gaW50cl9wb2xhcml0eSk7Citp bnQgYXJtX2lycV9kZXNjcmliZSh1X2ludCwgdm9pZCAqLCBjb25zdCBjaGFyICopOworCit1X2lu dCBhcm1faXJxX25leHRfY3B1KHVfaW50IGN1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IHVpbnQz Ml90ICppbnRyY2VsbHMsIGludCAqaW50ZXJydXB0LAogICAgIGludCAqdHJpZywgaW50ICpwb2wp OwpAQCAtOTMsNCArMTc4LDggQEAKIGludCBhcm1fZmR0X21hcF9pcnEocGhhbmRsZV90LCBwY2Vs bF90ICosIGludCk7CiAjZW5kaWYKIAorI2VuZGlmIC8qIEFSTV9JTlRSTkcgKi8KKwordm9pZCBh cm1faXJxX21lbW9yeV9iYXJyaWVyKHVpbnRwdHJfdCk7CisKICNlbmRpZgkvKiBfTUFDSElORV9J TlRSX0ggKi8KSW5kZXg6IHN5cy9hcm0vaW5jbHVkZS9zbXAuaAo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMv YXJtL2luY2x1ZGUvc21wLmgJKHJldmlzaW9uIDI3OTY4NSkKKysrIHN5cy9hcm0vaW5jbHVkZS9z bXAuaAkod29ya2luZyBjb3B5KQpAQCAtNiw2ICs2LDE4IEBACiAjaW5jbHVkZSA8c3lzL19jcHVz ZXQuaD4KICNpbmNsdWRlIDxtYWNoaW5lL3BjYi5oPgogCisjaWZkZWYgQVJNX0lOVFJORworZW51 bSB7CisJSVBJX0FTVCwKKwlJUElfUFJFRU1QVCwKKwlJUElfUkVOREVaVk9VUywKKwlJUElfU1RP UCwKKwlJUElfU1RPUF9IQVJEID0gSVBJX1NUT1AsIC8qIFRoZXNlIGFyZSBzeW5vbnltcyBvbiBh cm0uICovCisJSVBJX0hBUkRDTE9DSywKKwlJUElfVExCLAorCUFSTV9JUElfQ09VTlQKK307Cisj ZWxzZQogI2RlZmluZSBJUElfQVNUCQkwCiAjZGVmaW5lIElQSV9QUkVFTVBUCTIKICNkZWZpbmUg SVBJX1JFTkRFWlZPVVMJMwpAQCAtMTMsNiArMjUsNyBAQAogI2RlZmluZSBJUElfU1RPUF9IQVJE CTQKICNkZWZpbmUgSVBJX0hBUkRDTE9DSwk2CiAjZG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QUlMUV9GT1JFQUNIKHJsZSwgcmwsIGxpbmspIHsKKwkJaWYg KHJsZS0+dHlwZSAhPSBTWVNfUkVTX0lSUSkKKwkJCWNvbnRpbnVlOworCisJCWVyciA9IGZkdF9k ZXNjcmliZV9pcnEoYnVmLCBzaXplb2YoYnVmKSwgcmxlLT5zdGFydCk7CisJCWlmIChlcnIgPCAw KQorCQkJc25wcmludGYoYnVmLCBzaXplb2YoYnVmKSwgIj8/PyIpOworCisJCXJldHZhbCArPSBw cmludGYoIiVzJXMiLCBwcmludGVkID8gIiwiIDogIiBpcnEgIiwgYnVmKTsKKwkJcHJpbnRlZCsr OworCX0KKworCXJldHVybiAocmV0dmFsKTsKK30KKyNlbmRpZgo= --20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=US-ASCII; name="intrng_gic_panda_01.diff" Content-Disposition: attachment; filename="intrng_gic_panda_01.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i6xu3s494 SW5kZXg6IHN5cy9hcm0vYXJtL2dpYy5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hcm0vYXJtL2dpYy5j CShyZXZpc2lvbiAyNzk2ODUpCisrKyBzeXMvYXJtL2FybS9naWMuYwkod29ya2luZyBjb3B5KQpA QCAtMzQsNiArMzQsOCBAQAogI2luY2x1ZGUgPHN5cy9jZGVmcy5oPgogX19GQlNESUQoIiRGcmVl QlNEJCIpOwogCisjaW5jbHVkZSAib3B0X3BsYXRmb3JtLmgiCisKICNpbmNsdWRlIDxzeXMvcGFy YW0uaD4KICNpbmNsdWRlIDxzeXMvc3lzdG0uaD4KICNpbmNsdWRlIDxzeXMvYnVzLmg+CkBAIC00 MCw2ICs0Miw3IEBACiAjaW5jbHVkZSA8c3lzL2tlcm5lbC5oPgogI2luY2x1ZGUgPHN5cy9rdHIu aD4KICNpbmNsdWRlIDxzeXMvbW9kdWxlLmg+CisjaW5j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ljIHZvaWQKK2FybV9naWNfZGlzYWJs ZV9pbnRyKGRldmljZV90IGRldiwgc3RydWN0IGFybV9pcnFzcmMgKmlzcmMpCit7Cit9CisKK3N0 YXRpYyBpbnQKK2FybV9naWNfdW5yZWdpc3RlcihkZXZpY2VfdCBkZXYsIHN0cnVjdCBhcm1faXJx c3JjICppc3JjKQoreworCXN0cnVjdCBhcm1fZ2ljX3NvZnRjICpzYyA9IGRldmljZV9nZXRfc29m dGMoZGV2KTsKKwl1X2ludCBpcnEgPSAodV9pbnQpaXNyYy0+aXNyY19kYXRhOworCisJcmV0dXJu IChnaWNfZGV0YWNoX2lzcmMoc2MsIGlzcmMsIGlycSkpOworfQorCitzdGF0aWMgdm9pZAorYXJt X2dpY19wcmVfaXRocmVhZChkZXZpY2VfdCBkZXYsIHN0cnVjdCBhcm1faXJxc3JjICppc3JjKQor eworCisJYXJtX2dpY19kaXNhYmxlX3NvdXJjZShkZXYsIGlzcmMpOworfQorCitzdGF0aWMgdm9p ZAorYXJtX2dpY19wb3N0X2l0aHJlYWQoZGV2aWNlX3QgZGV2LCBzdHJ1Y3QgYXJtX2lycXNyYyAq aXNyYykKK3sKKworCWFybV9naWNfZW5hYmxlX3NvdXJjZShkZXYsIGlzcmMpOworfQorCitzdGF0 aWMgdm9pZAorYXJtX2dpY19wb3N0X2ZpbHRlcihkZXZpY2VfdCBkZXYsIHN0cnVjdCBhcm1faXJx c3JjICppc3JjKQoreworCisJLyogRU9JIG11c3QgYmUgZG9uZSBpbiBjb250cm9sbGVyJ3MgaW50 ZXJydXB0IHJvdXRpbmUuICovCit9CisKKyNpZmRlZiBTTVAKK3N0YXRpYyBpbnQKK2FybV9naWNf YmluZChkZXZpY2VfdCBkZXYsIHN0cnVjdCBhcm1faXJxc3JjICppc3JjKQoreworCXN0cnVjdCBh cm1fZ2ljX3NvZnRjICpzYyA9IGRldmljZV9nZXRfc29mdGMoZGV2KTsKKwl1aW50MzJfdCBpcnEg PSAodV9pbnQpaXNyYy0+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T09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hcm0vY29uZi9Q QU5EQUJPQVJECShyZXZpc2lvbiAyNzk2ODUpCisrKyBzeXMvYXJtL2NvbmYvUEFOREFCT0FSRAko d29ya2luZyBjb3B5KQpAQCAtMzIsNiArMzIsOCBAQAogbWFrZW9wdGlvbnMJTU9EVUxFU19PVkVS UklERT0iIgogbWFrZW9wdGlvbnMJV0lUSE9VVF9NT0RVTEVTPSJhaGMiCiAKK29wdGlvbnMJCUFS TV9JTlRSTkcJCSMgbmV3IGludGVycnVwdCBmcmFtZXdvcmsKKwogb3B0aW9ucyAJSFo9MTAwCiBv cHRpb25zIAlTQ0hFRF9VTEUJCSMgVUxFIHNjaGVkdWxlcgogb3B0aW9ucyAJUFJFRU1QVElPTgkJ IyBFbmFibGUga2VybmVsIHRocmVhZCBwcmVlbXB0aW9uCkluZGV4OiBzeXMvYXJtL3RpL29tYXA0 L29tYXA0X21wLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2FybS90aS9vbWFwNC9vbWFwNF9tcC5jCShy ZXZpc2lvbiAyNzk2ODUpCisrKyBzeXMvYXJtL3RpL29tYXA0L29tYXA0X21wLmMJKHdvcmtpbmcg Y29weSkKQEAgLTQxLDcgKzQxLDggQEAKIHZvaWQKIHBsYXRmb3JtX21wX2luaXRfc2Vjb25kYXJ5 KHZvaWQpCiB7Ci0JYXJtX2luaXRfc2Vjb25kYXJ5X2ljKCk7CisKKwlhcm1fcGljX2luaXRfc2Vj b25kYXJ5KCk7CiB9CiAKIHZvaWQKSW5kZXg6IHN5cy9hcm0vdGkvb21hcDQvc3RkLm9tYXA0Cj09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0KLS0tIHN5cy9hcm0vdGkvb21hcDQvc3RkLm9tYXA0CShyZXZpc2lvbiAyNzk2ODUp CisrKyBzeXMvYXJtL3RpL29tYXA0L3N0ZC5vbWFwNAkod29ya2luZyBjb3B5KQpAQCAtMTcsNyAr MTcsMyBAQAogb3B0aW9ucwkJU09DX09NQVA0CiAKIG9wdGlvbnMJCUFSTV9MMl9QSVBUCi0KLW9w dGlvbnMJCUlQSV9JUlFfU1RBUlQ9MAotb3B0aW9ucwkJSVBJX0lSUV9FTkQ9MTUKLQo= --20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=US-ASCII; name="intrng_aintc_01.diff" Content-Disposition: attachment; filename="intrng_aintc_01.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i6xu3yn25 SW5kZXg6IHN5cy9hcm0vY29uZi9CRUFHTEVCT05FCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hcm0vY29u Zi9CRUFHTEVCT05FCShyZXZpc2lvbiAyNzk2ODUpCisrKyBzeXMvYXJtL2NvbmYvQkVBR0xFQk9O RQkod29ya2luZyBjb3B5KQpAQCAtMzMsNiArMzMsOCBAQAogbWFrZW9wdGlvbnMgICAgICAgICBX SVRIX0NURj0xCiBtYWtlb3B0aW9ucyAgICAgTU9EVUxFU19PVkVSUklERT0ib3BlbnNvbGFyaXMg ZHRyYWNlIGR0cmFjZS9sb2Nrc3RhdCBkdHJhY2UvcHJvZmlsZSBkdHJhY2UvZmJ0IgoKK29wdGlv bnMJCUFSTV9JTlRSTkcKKwogb3B0aW9ucyAJSFo9MTAwCiBvcHRpb25zIAlTQ0hFRF80QlNECQkj IDRCU0Qgc2NoZWR1bGVyCiBvcHRpb25zIAlQUkVFTVBUSU9OCQkjIEVuYWJsZSBrZXJuZWwgdGhy ZWFkIHByZWVtcHRpb24KSW5kZXg6IHN5cy9hcm0vdGkvYWludGMuYwo9PT09PT09PT09PT09PT09 PT09PT09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ZiBzaGFyZWQgaW50ZXJydXB0IGNhbWUgaGVyZSBhdCB0aGUgc2FtZSBtb21lbnQuCisJICov CisJaWYgKCFhdG9taWNfY21wc2V0X2FjcV9wdHIoKHZvaWQgKikmc2MtPmFpbnRjX2lycXNbaXJx XSwgMCwKKwkgICAgKGludHB0cl90KWlzcmMpKQorCQlyZXR1cm4gKHNjLT5haW50Y19pcnFzW2ly cV0gPT0gaXNyYyA/IDAgOiBFRVhJU1QpOworCWlzcmMtPmlzcmNfZGF0YSA9ICh2b2lkICopaXJx OworCisJbmFtZSA9IGRldmljZV9nZXRfbmFtZXVuaXQoc2MtPmFpbnRjX2Rldik7CisJYXJtX2ly cV9zZXRfbmFtZShpc3JjLCAiJXMscyV1IiwgbmFtZSwgaXJxKTsKKwlyZXR1cm4gKDApOworfQor CitzdGF0aWMgaW50Cit0aV9haW50Y19kZXRhY2hfaXNyYyhzdHJ1Y3QgdGlfYWludGNfc29mdGMg KnNjLCBzdHJ1Y3QgYXJtX2lycXNyYyAqaXNyYywKKyAgICB1X2ludCBpcnEpCit7CisKKwlpZiAo IWF0b21pY19jbXBzZXRfYWNxX3B0cigodm9pZCAqKSZzYy0+YWludGNfaXJxc1tpcnFdLAorCSAg ICAoaW50cHRyX3QpaXNyYywgMCkpCisJCXJldHVybiAoRUlOVkFMKTsKKwlpc3JjLT5pc3JjX2Rh dGEgPSBOVUxMOworCisJYXJtX2lycV9zZXRfbmFtZShpc3JjLCAiIik7CisJcmV0dXJuICgwKTsK K30KKworc3RhdGljIGludAordGlfYWludGNfbWFwX25zcGMoc3RydWN0IHRpX2FpbnRjX3NvZnRj ICpzYywgc3RydWN0IGFybV9pcnFzcmMgKmlzcmMpCit7CisJdV9pbnQgaXJxOworCisJaWYgKGlz cmMtPmlzcmNfbnNwY190eXBlICE9IEFSTV9JUlFfTlNQQ19QTEFJTiAmJgorCSAgICBpc3JjLT5p c3JjX25zcGNfdHlwZSAhPSBBUk1fSVJRX05TUENfSVJRKQorCQlyZXR1cm4gKEVJTlZBTCk7CisK KwlpcnEgPSBpc3JjLT5pc3JjX25zcGNfbnVtOworCWlmIChpcnEgPj0gc2MtPmFpbnRjX25pcnFz KQorCQlyZXR1cm4gKEVJTlZBTCk7CisKKwlyZXR1cm4gKHRpX2FpbnRjX2F0dGFjaF9pc3JjKHNj LCBpc3JjLCBpcnEpKTsKK30KKworI2lmZGVmIEZEVAorc3RhdGljIGludAordGlfYWludGNfbWFw X2ZkdChzdHJ1Y3QgdGlfYWludGNfc29mdGMgKnNjLCBzdHJ1Y3QgYXJtX2lycXNyYyAqaXNyYykK K3sKKwl1X2ludCBpcnE7CisJaW50IGVycm9yOworCisJaWYgKGlzcmMtPmlzcmNfbmNlbGxzICE9 IDEpCisJCXJldHVybiAoRUlOVkFMKTsKKworCWlycSA9IGlzcmMtPmlzcmNfY2VsbHNbMF07CisJ aWYgKGlycSA+PSBzYy0+YWludGNfbmlycXMpCisJCXJldHVybiAoRUlOVkFMKTsKKworCWVycm9y ID0gdGlfYWludGNfYXR0YWNoX2lzcmMoc2MsIGlzcmMsIGlycSk7CisJaWYgKGVycm9yICE9IDAp CisJCXJldHVybiAoZXJyb3IpOworCisJaXNyYy0+aXNyY19uc3BjX3R5cGUgPSBBUk1fSVJRX05T UENfUExBSU47CisJaXNyYy0+aXNyY19uc3BjX251bSA9IGlycTsKKwlyZXR1cm4gKDApOworfQor I2VuZGlmCisKK3N0YXRpYyBpbnQKK3RpX2FpbnRjX3JlZ2lzdGVyKGRldmljZV90IGRldiwgc3Ry dWN0IGFybV9pcnFzcmMgKmlzcmMsIGJvb2xlYW5fdCAqaXNfcGVyY3B1KQoreworCXN0cnVjdCB0 aV9haW50Y19zb2Z0YyAqc2MgPSBkZXZpY2VfZ2V0X3NvZnRjKGRldik7CisKKwkqaXNfcGVyY3B1 ID0gRkFMU0U7CisKKwlpZiAoaXNyYy0+aXNyY190eXBlID09IEFSTV9JU1JDVF9OQU1FU1BBQ0Up CisJCXJldHVybiAodGlfYWludGN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XJxKQogewpAQCAtMTYwLDcgKzQ1Miw3IEBA CgogCS8qIENoZWNrIGZvciBzcHVyaW91cyBpbnRlcnJ1cHQgKi8KIAlpZiAoKGFjdGl2ZV9pcnEg JiAweGZmZmZmZjgwKSkgewotCQlkZXZpY2VfcHJpbnRmKHNjLT5zY19kZXYsCisJCWRldmljZV9w cmludGYoc2MtPmFpbnRjX2RldiwKIAkJICAgICJTcHVyaW91cyBpbnRlcnJ1cHQgZGV0ZWN0ZWQg KDB4JTA4eClcbiIsIGFjdGl2ZV9pcnEpOwogCQlhaW50Y193cml0ZV80KHNjLCBJTlRDX1NJUl9J UlEsIDApOwogCQlyZXR1cm4gLTE7CkBAIC0xODgsMyArNDgwLDQgQEAKIAlhcm1faXJxX21lbW9y eV9iYXJyaWVyKG5iKTsKIAlhaW50Y193cml0ZV80KHNjLCBJTlRDX01JUl9DTEVBUihuYiA+PiA1 KSwgKDFVTCA8PCAobmIgJiAweDFGKSkpOwogfQorI2VuZGlmCg== --20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=US-ASCII; name="intrng_ti_gpio_panda_bbb_01.diff" Content-Disposition: attachment; filename="intrng_ti_gpio_panda_bbb_01.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i6xu4d896 SW5kZXg6IHN5cy9hcm0vdGkvdGlfZ3Bpby5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hcm0vdGkvdGlf Z3Bpby5jCShyZXZpc2lvbiAyNzk2ODUpCisrKyBzeXMvYXJtL3RpL3RpX2dwaW8uYwkod29ya2lu ZyBjb3B5KQpAQCAtMzMsNiArMzMsOCBAQAogI2luY2x1ZGUgPHN5cy9jZGVmcy5oPgogX19GQlNE SUQoIiRGcmVlQlNEJCIpOwogCisjaW5jbHVkZSAib3B0X3BsYXRmb3JtLmgiCisKICNpbmNsdWRl IDxzeXMvcGFyYW0uaD4KICNpbmNs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biBpcyBhIHR1 cGxlOiA8bW9kZSwgcmVzZXQsIGdwaW9fcGluPgogCQkJICogbW9kZSBpcyBvbmUgb2YgdGhlIGZv bGxvd2luZyB2YWx1ZXM6CiAJCQkgKiAgIDAgLSB1bmtub3duCkBAIC0xNDAsNyArMTQzLDcgQEAK IAkJCSAqICAgMiAtIFRMTAogCQkJICogICAzIC0gSFNJQwogCQkJICoKLQkJCSAqIHJlc2V0IGlu ZGljYXRlcyAoaWYgbm9uLXplcm8pIGlmIHBvcnQgcmVzZXQgaXMgcmVxdWlyZWQgCisJCQkgKiBy ZXNldCBpbmRpY2F0ZXMgKGlmIG5vbi16ZXJvKSBpZiBwb3J0IHJlc2V0IGlzIHJlcXVpcmVkCiAJ CQkgKiBncGlvX3BpbiAtIEdQSU8gcGluIHRoYXQgaXMgdXNlZCB0byBwZXJmb3JtIHJlc2V0CiAJ CQkgKi8KIAkJCXBoeS1jb25maWcgPSA8ICAxIDAgMApAQCAtMTc3LDggKzE4MCwxNSBAQAogCQkJ bm9uLXJlbW92YWJsZTsgLyogWFhYIG5lZWQgcmVhbCBzb2x1dGlvbiAqLwogCQl9OwogCisJCXRl c3RAMCB7CisJCQljb21wYXRpYmxlID0gImdwaW8tdGVzdCI7CisJCQlyZWcgPSA8MHgwPjsKKwkJ CWludGVycnVwdC1wYXJlbnQgPSA8JkdQSU8+OworCQkJaW50ZXJydXB0cyA9IDwxMTMgMHgyPjsK IAl9OwogCisJfTsKKwogCWNob3NlbiB7CiAJCXN0ZGluID0gInVhcnQzIjsKIAkJc3Rkb3V0ID0g InVhcnQzIjsK --20cf30223fb18e26520510a22522 Content-Type: text/plain; charset=US-ASCII; name="interrupt.h.diff" Content-Disposition: attachment; filename="interrupt.h.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i6xu4hn47 SW5kZXg6IHN5cy9zeXMvaW50ZXJydXB0LmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL3N5cy9pbnRlcnJ1 cHQuaAkocmV2aXNpb24gMjc5Njg1KQorKysgc3lzL3N5cy9pbnRlcnJ1cHQuaAkod29ya2luZyBj b3B5KQpAQCAtMTA1LDcgKzEwNSw3IEBACiAJVEFJTFFfRU5UUlkoaW50cl9ldmVudCkgaWVfbGlz dDsKIAlUQUlMUV9IRUFEKCwgaW50cl9oYW5kbGVyKSBpZV9oYW5kbGVyczsgLyogSW50ZXJydXB0 IGhhbmRsZXJzLiAqLwogCWNoYXIJCWllX25hbWVbTUFYQ09NTEVOICsgMV07IC8qIEluZGl2aWR1 YWwgZXZlbnQgbmFtZS4gKi8KLQljaGFyCQlpZV9mdWxsbmFtZVtNQVhDT01MRU4gKyAxXTsKKwlj aGFyCQlpZV9mdWxsbmFtZVsyKk1BWENPTUxFTiArIDFdOwogCXN0cnVjdCBtdHgJaWVfbG9jazsK IAl2b2lkCQkqaWVfc291cmNlOwkvKiBDb29raWUgdXNlZCBieSBNRCBjb2RlLiAqLwogCXN0cnVj dCBpbnRyX3RocmVhZCAqaWVfdGhyZWFkOwkvKiBUaHJlYWQgd2UgYXJlIGNvbm5lY3RlZCB0by4g Ki8K --20cf30223fb18e26520510a22522--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFHCsPUkcTyEhj7NhmsWtJ7hht8PNAnHnwMPbbjH_SDWJMm0KQ>