From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i6kZY-0004JZ-He for barebox@lists.infradead.org; Sat, 07 Sep 2019 23:56:54 +0000 Received: by mail-pl1-x644.google.com with SMTP id b10so4885544plr.4 for ; Sat, 07 Sep 2019 16:56:52 -0700 (PDT) From: Andrey Smirnov Date: Sat, 7 Sep 2019 16:56:45 -0700 Message-Id: <20190907235645.22442-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] ARM: aarch64: Re-implement most of barebox_arm_entry() in assembly To: barebox@lists.infradead.org Cc: Andrey Smirnov R0NDOSBub3cgcHJvZHVjZXMgdGhlIGZvbGxvd2luZyB3YXJuaW5nOgoKY29tbW9uLmg6NTE6Mjog d2FybmluZzogbGlzdGluZyB0aGUgc3RhY2sgcG9pbnRlciByZWdpc3RlciDigJhzcOKAmSBpbiBh IGNsb2JiZXIgbGlzdCBpcyBkZXByZWNhdGVkIFstV2RlcHJlY2F0ZWRdCiAgIDUxIHwgIF9fYXNt X18gX192b2xhdGlsZV9fKCJtb3Ygc3AsICUwIgogICAgICB8ICBefn5+fn5+CmNvbW1vbi5oOjUx OjI6IG5vdGU6IHRoZSB2YWx1ZSBvZiB0aGUgc3RhY2sgcG9pbnRlciBhZnRlciAgYW4g4oCYYXNt 4oCZIHN0YXRlbWVudCBtdXN0IGJlIHRoZSBzYW1lIGFzIGl0IHdhcyBiZWZvcmUgdGhlIHN0YXRl bWVudAoKU3RhY2sgcG9pbnRlciB3YXMgYWRkZWQgdG8gY2xvYmJlciBsaXN0IGluIGNvbW1pdCBm OWZjODI1NGIyICgiQV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