From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.visioncatalog.com ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFjZU-0000eu-5L for barebox@lists.infradead.org; Thu, 16 Jul 2015 13:51:34 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 42D2FA0023D for ; Thu, 16 Jul 2015 15:52:48 +0200 (CEST) From: Daniel Schultz Date: Thu, 16 Jul 2015 15:50:33 +0200 Message-Id: <1437054633-14482-1-git-send-email-d.schultz@phytec.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [RFC] commands: Add dhrystone To: barebox@lists.infradead.org VGhpcyB0b29sIHdpbGwgaGVscCB0byBtZWFzdXJlIHRoZSBzeXN0ZW0gcGVyZm9ybWFuY2UuCgpT aWduZWQtb2ZmLWJ5OiBEYW5pZWwgU2NodWx0eiA8ZC5zY2h1bHR6QHBoeXRlYy5kZT4KLS0tCiBj b21tYW5kcy9LY29uZmlnICAgICB8ICAgNyArCiBjb21tYW5kcy9NYWtlZmlsZSAgICB8ICAgMSAr CiBjb21tYW5kcy9kaHJ5c3RvbmUuYyB8IDQwNCArKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysKIDMgZmlsZXMgY2hhbmdlZCwgNDEyIGluc2VydGlvbnMo KykKIGNyZWF0ZSBtb2RlIDEwMDY0NCBjb21tYW5kcy9kaHJ5c3RvbmUuYwoKZGlmZiAtLWdpdCBh L2NvbW1hbmRzL0tjb25maWcgYi9jb21tYW5kcy9LY29uZmlnCmluZGV4IGJiNjY3NGUuLjliMTEw OWUgMTAwNjQ0Ci0tLSBhL2Nv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2wgY2hlY2tfaWRlbnQoZW51bSBpZGVudHMgaWRlbnQpCit7CisJaWYgKGlkZW50ID09 IGlkZW50XzMpCisJCXJldHVybiB0cnVlOworCWVsc2UKKwkJcmV0dXJuIGZhbHNlOworfQorCit2 b2lkIHByb2NfNyhpbnQgaW5wdXRfMSwgaW50IGlucHV0XzIsIGludCAqb3V0KQoreworCSpvdXQg PSBpbnB1dF8yICsgaW5wdXRfMSArIDI7Cit9CisKK3ZvaWQgcHJvY182KGVudW0gaWRlbnRzIGlk ZW50LCBlbnVtIGlkZW50cyAqaWRlbnRfb3V0KQoreworCSppZGVudF9vdXQgPSBpZGVudDsKKwlp ZiAoIWNoZWNrX2lkZW50KGlkZW50KSkKKwkJKmlkZW50X291dCA9IGlkZW50XzQ7CisJc3dpdGNo IChpZGVudCkgeworCWNhc2UgaWRlbnRfMToKKwkJKmlkZW50X291dCA9IGlkZW50XzE7CisJCWJy ZWFrOworCWNhc2UgaWRlbnRfMjoKKwkJaWYgKGludF9nbG9iID4gMTAwKQorCQkJKmlkZW50X291 dCA9IGlkZW50XzE7CisJCWVsc2UKKwkJCSppZGVudF9vdXQgPSBpZGVudF80OworCQlicmVhazsK KwljYXNlIGlkZW50XzM6CisJCSppZGVudF9vdXQgPSBpZGVudF8yOworCQlicmVhazsKKwljYXNl IGlkZW50XzQ6CisJCWJyZWFrOworCWNhc2UgaWRlbnRfNToKKwkJKmlkZW50X291dCA9IGlkZW50 XzM7CisJCWJyZWFrOworCX0KK30KKwordm9pZCBmaWxsX3JlY29yZChzdHJ1Y3QgcmVjb3JkICpy ZWNvcmQpCit7CisJc3RydWN0IHJlY29yZCAqbmV4dF9yZWNvcmQgPSByZWNvcmQtPnB0cl9jb21w OworCisJKnJlY29yZC0+cHRyX2NvbXAgPSAqcmVjb3JkX2dsb2I7CisJcmVjb3JkLT52YXJpYW50 LnZhcl8xLmludF9jb21wID0gNTsKKwluZXh0X3JlY29yZC0+dmFyaWFudC52YXJfMS5pbnRfY29t cCA9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FyXzFfZ2xvYiA9ICdBJzsKKwlib29sX2dsb2IgPSBm YWxzZTsKK30KKworLyogZGhyeV8yLmMgKi8KKwordm9pZCBmaWxsX2FycmF5KGludCBhcnJfMVs1 MF0sIGludCBhcnJfMls1MF1bNTBdLCBpbnQgdmFsXzEsIGludCB2YWxfMikKK3sKKwlpbnQgaTsK KwlpbnQgb2Zmc2V0OworCisJb2Zmc2V0ID0gdmFsXzEgKyA1OworCWFycl8xW29mZnNldF0gPSB2 YWxfMjsKKwlhcnJfMVtvZmZzZXQrMV0gPSBhcnJfMVtvZmZzZXRdOworCWFycl8xW29mZnNldCsz MF0gPSBvZmZzZXQ7CisJZm9yIChpID0gb2Zmc2V0OyBpIDw9IG9mZnNldCsxOyArK2kpCisJCWFy cl8yW29mZnNldF1baV0gPSBvZmZzZXQ7CisJYXJyXzJbb2Zmc2V0XVtvZmZzZXQtMV0gKz0gMTsK KwlhcnJfMltvZmZzZXQrMjBdW29mZnNldF0gPSBhcnJfMVtvZmZzZXRdOworCWludF9nbG9iID0g NTsKK30KKworc3RhdGljIGludCBkb19kaHJ5c3RvbmUoaW50IGFyZ2MsIGNoYXIgKmFyZ3ZbXSkK K3sKKwkvKiBtYWluIHByb2dyYW0sIGNvcnJlc3BvbmRzIHRvIHByb2NlZHVyZXMgICAgICAgICov CisJLyogTWFpbiBhbmQgUHJvY18wIGluIHRoZSBBZGEgdmVyc2lvbiAgICAgICAgICAgICAqLwor CWludAkJaW50XzE7CisJaW50CQlpbnRfMjsKKwlpbnQJCWludF8zOworCWNoYXIJCWNoYXJfaTsK KwllbnVtIGlkZW50cwlpZGVudDsKKwljaGFyCQlzdHJfMVszMV07CisJY2hhcgkJc3RyXzJbMzFd OworCWludAkJaTsKKwlpbnQJCW51bWJlcl9vZl9ydW5zOworCisJLyogYmFyZWJveCBjbWQgKi8K KwlpZiAoYXJnYyA8IDIpCisJCXJldHVybiBDT01NQU5EX0VSUk9SX1VTQUdFOworCW51bWJlcl9v Zl9ydW5zID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51bWJlcl9vZl9ydW5zID4gMzIwMDAsICAqLwor CS8qIG92ZXJmbG93IG1heSBvY2N1ciBmb3IgdGhpcyBhcnJheSBlbGVtZW50LiAgICAgICAgICAg ICAgICAgICAqLworCisJcHJpbnRmKCJcbiIpOworCXByaW50ZigiRGhyeXN0b25lIEJlbmNobWFy aywgVmVyc2lvbiAyLjEgKExhbmd1YWdlOiBDKVxuIik7CisJcHJpbnRmKCJcbiIpOworCXByaW50 ZigiUHJvZ3JhbSBjb21waWxlZCB3aXRob3V0ICdyZWdpc3RlcicgYXR0cmlidXRlXG4iKTsKKwlw cmludGYoIlxuIik7CisJcHJpbnRmKCJFeGVjdXRpb24gc3RhcnRzLCAlZCBydW5zIHRocm91Z2gg RGhyeXN0b25lXG4iLCBudW1iZXJfb2ZfcnVucyk7CisKKwkvKioqKioqKioqKioqKioqLworCS8q IFN0YXJ0IHRpbWVyICovCisJLyoqKioqKioqKioqKioqKi8KKwliZWdpbl90aW1lID0gZ2V0X3Rp bWVfbnMoKTsKKworCWZvciAoaSA9IDE7IGkgPD0gbnVtYmVyX29mX3J1bnM7ICsraSkgeworCQlw cm9jXzUoKTsKKwkJcHJvY180KCk7CisJCS8qIGNoYXJfMV9nbG9iID09ICdBJywgY2hhcl8yX2ds b2IgPT0gJ0InLCBib29sX2dsb2IgPT0gdHJ1ZSAqLworCQlpbnRfMSA9IDI7CisJCWludF8yID0g MzsKKwkJc3RyY3B5KHN0cl8yLCAiREhSWVNUT05FIFBST0dSQU0sIDInTkQgU1RSSU5HIik7CisJ CWlkZW50ID0gaWRlbnRfMjsKKwkJYm9vbF9nbG9iID0gIWNvbXBhcmVfc3RycyhzdHJfMSwgc3Ry XzIpOworCQkvKiBib29sX2dsb2IgPT0gMSAqLworCQl3aGlsZSAoaW50XzEgPCBpbnRfMikgewor CQkJaW50XzMgPSA1ICogaW50XzEgLSBpbnRfMjsKKwkJCS8qIGludF8zID09IDcgKi8KKwkJCXBy b2NfNyhpbnRfMSwgaW50XzIsICZpbnRfMyk7CisJCQkvKiBpbnRfMyA9PSA3ICovCisJCQlpbnRf MSArPSAxOworCQl9CisJCS8qIGludF8xID09IDMsIGludF8yID09IDMsIGludF8zID09IDcgKi8K KwkJZmlsbF9hcnJheShhcnJfMV9nbG9iLCBhcnJfMl9nbG9iLCBpbnRfMSwgaW50XzMpOworCQkv KiBpbnRfZ2xvYiA9PSA1ICovCisJCWZpbGxfcmVjb3JkKHJlY29yZF9nbG9iKTsKKwkJZm9yIChj aGFyX2kgPSAnQSc7IGNoYXJfaSA8PSBjaGFyXzJfZ2xvYjsgKytjaGFyX2kpIHsKKwkJCWlmIChp ZGVudCA9PSBjb21wYXJlX2NoYXJzKGNoYXJfaSwgJ0MnKSkgeworCQkJCXByb2NfNihpZGVudF8x LCAmaWRlbnQpOworCQkJCXN0cmNweShzdHJfMiwKKwkJCQkJIkRIUllTVE9ORSBQUk9HUkFNLCAz J1JEIFNUUklORyIpOworCQkJCWludF8yID0gaTsKKwkJCQlpbnRfZ2xvYiA9IGk7CisJCQl9CisJ CX0KKwkJLyogaW50XzEgPT0gMywgaW50XzIgPT0gMywgaW50XzMgPT0gNyAqLworCQlpbnRfMiA9 IGludF8yICogaW50XzE7CisJCWludF8xID0gaW50XzIgLyBpbnRfMzsKKwkJaW50XzIgPSA3ICog KGludF8yIC0gaW50XzMpIC0gaW50XzE7CisJCS8qIGludF8xID09IDEsIGludF8yID09IDEzLCBp bnRfMyA9PSA3ICovCisJCXByb2NfMigmaW50XzEpOworCQkvKiBpbnRfMSA9PSA1ICovCisJfQor CisJLyoqKioqKioqKioqKioqLworCS8qIFN0b3AgdGltZXIgKi8KKwkvKioqKioqKioqKioqKiov CisJZW5kX3RpbWUgPSBnZXRfdGltZV9ucygpOworCisJcHJpbnRmKCJFeGVjdXRpb24gZW5kc1xu Iik7CisJcHJpbnRmKCJcbiIpOworCXByaW50ZigiRmluYWwgdmFsdWVzIG9mIHRoZSB2YXJpYWJs ZXMgdXNlZCBpbiB0aGUgYmVuY2htYXJrOlxuIik7CisJcHJpbnRmKCJcbiIpOworCXByaW50Zigi aW50X2dsb2I6ICAgICAgICAgICAgJWRcbiIsIGludF9nbG9iKTsKKwlwcmludGYoIiAgICAgICAg c2hvdWxkIGJlOiAgICVkXG4iLCA1KTsKKwlwcmludGYoImJvb2xfZ2xvYjogICAgICAgICAgICVk XG4iLCBib29sX2dsb2IpOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6ICAgJWRcbiIsIDEp OworCXByaW50ZigiY2hhcl8xX2dsb2I6ICAgICAgICAgJWNcbiIsIGNoYXJfMV9nbG9iKTsKKwlw cmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgICVjXG4iLCAnQScpOworCXByaW50ZigiY2hhcl8y X2dsb2I6ICAgICAgICAgJWNcbiIsIGNoYXJfMl9nbG9iKTsKKwlwcmludGYoIiAgICAgICAgc2hv dWxkIGJlOiAgICVjXG4iLCAnQicpOworCXByaW50ZigiYXJyXzFfZ2xvYls4XTogICAgICAgJWRc biIsIGFycl8xX2dsb2JbOF0pOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6ICAgJWRcbiIs IDcpOworCXByaW50ZigiYXJyXzJfZ2xvYls4XVs3XTogICAgJWRcbiIsIGFycl8yX2dsb2JbOF1b N10pOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6ICAgbnVtYmVyX29mX3J1bnMgKyAxMFxu Iik7CisJcHJpbnRmKCJyZWNvcmRfZ2xvYi0+XG4iKTsKKwlwcmludGYoIiAgcHRyX2NvbXA6ICAg ICAgICAgICVkXG4iLCAoaW50KSByZWNvcmRfZ2xvYi0+cHRyX2NvbXApOworCXByaW50ZigiICAg ICAgICBzaG91bGQgYmU6ICAgKGltcGxlbWVudGF0aW9uLWRlcGVuZGVudClcbiIpOworCXByaW50 ZigiICBkaXNjcjogICAgICAgICAgICAgJWRcbiIsIHJlY29yZF9nbG9iLT5kaXNjcik7CisJcHJp bnRmKCIgICAgICAgIHNob3VsZCBiZTogICAlZFxuIiwgMCk7CisJcHJpbnRmKCIgIGVudW1fY29t cDogICAgICAgICAlZFxuIiwKKwkJcmVjb3JkX2dsb2ItPnZhcmlhbnQudmFyXzEuZW51bV9jb21w KTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgICVkXG4iLCAyKTsKKwlwcmludGYoIiAg aW50X2NvbXA6ICAgICAgICAgICVkXG4iLAorCQlyZWNvcmRfZ2xvYi0+dmFyaWFudC52YXJfMS5p bnRfY29tcCk7CisJcHJpbnRmKCIgICAgICAgIHNob3VsZCBiZTogICAlZFxuIiwgMTcpOworCXBy aW50ZigiICBzdHJfY29tcDogICAgICAgICAgJXNcbiIsCisJCXJlY29yZF9nbG9iLT52YXJpYW50 LnZhcl8xLnN0cl9jb21wKTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgIERIUllTVE9O RSBQUk9HUkFNLCBTT01FIFNUUklOR1xuIik7CisJcHJpbnRmKCJuZXh0X3JlY29yZF9nbG9iLT5c biIpOworCXByaW50ZigiICBwdHJfY29tcDogICAgICAgICAgJWRcbiIsIChpbnQpIG5leHRfcmVj b3JkX2dsb2ItPnB0cl9jb21wKTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgIChpbXBs ZW1lbnRhdGlvbi1kZXBlbmRlbnQpLCBzYW1lIGFzIGFib3ZlXG4iKTsKKwlwcmludGYoIiAgZGlz Y3I6ICAgICAgICAgICAgICVkXG4iLCBuZXh0X3JlY29yZF9nbG9iLT5kaXNjcik7CisJcHJpbnRm KCIgICAgICAgIHNob3VsZCBiZTogICAlZFxuIiwgMCk7CisJcHJpbnRmKCIgIGVudW1fY29tcDog ICAgICAgICAlZFxuIiwKKwkJbmV4dF9yZWNvcmRfZ2xvYi0+dmFyaWFudC52YXJfMS5lbnVtX2Nv bXApOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6ICAgJWRcbiIsIDEpOworCXByaW50Zigi ICBpbnRfY29tcDogICAgICAgICAgJWRcbiIsCisJCW5leHRfcmVjb3JkX2dsb2ItPnZhcmlhbnQu dmFyXzEuaW50X2NvbXApOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6ICAgJWRcbiIsIDE4 KTsKKwlwcmludGYoIiAgc3RyX2NvbXA6ICAgICAgICAgICVzXG4iLAorCQluZXh0X3JlY29yZF9n bG9iLT52YXJpYW50LnZhcl8xLnN0cl9jb21wKTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJl OiAgIERIUllTVE9ORSBQUk9HUkFNLCBTT01FIFNUUklOR1xuIik7CisJcHJpbnRmKCJpbnRfMTog ICAgICAgICAgICAgICAlZFxuIiwgaW50XzEpOworCXByaW50ZigiICAgICAgICBzaG91bGQgYmU6 ICAgJWRcbiIsIDUpOworCXByaW50ZigiaW50XzI6ICAgICAgICAgICAgICAgJWRcbiIsIGludF8y KTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgICVkXG4iLCAxMyk7CisJcHJpbnRmKCJp bnRfMzogICAgICAgICAgICAgICAlZFxuIiwgaW50XzMpOworCXByaW50ZigiICAgICAgICBzaG91 bGQgYmU6ICAgJWRcbiIsIDcpOworCXByaW50ZigiaWRlbnQ6ICAgICAgICAgICAgICAgJWRcbiIs IGlkZW50KTsKKwlwcmludGYoIiAgICAgICAgc2hvdWxkIGJlOiAgICVkXG4iLCAxKTsKKwlwcmlu dGYoInN0cl8xOiAgICAgICAgICAgICAgICVzXG4iLCBzdHJfMSk7CisJcHJpbnRmKCIgICAgICAg IHNob3VsZCBiZTogICBESFJZU1RPTkUgUFJPR1JBTSwgMSdTVCBTVFJJTkdcbiIpOworCXByaW50 Zigic3RyXzI6ICAgICAgICAgICAgICAgJXNcbiIsIHN0cl8yKTsKKwlwcmludGYoIiAgICAgICAg c2hvdWxkIGJlOiAgIERIUllTVE9ORSBQUk9HUkFNLCAyJ05EIFNUUklOR1xuIik7CisJcHJpbnRm KCJcbiIpOworCisJdXNlcl90aW1lID0g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