From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 277A670 for ; Mon, 19 Jul 2021 23:22:03 +0000 (UTC) Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 0065BC689B for ; Mon, 19 Jul 2021 22:57:59 +0000 (UTC) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 7D657200004; Mon, 19 Jul 2021 22:57:51 +0000 (UTC) Date: Tue, 20 Jul 2021 00:57:51 +0200 From: Alexandre Belloni To: Wedson Almeida Filho Cc: Linus Walleij , Miguel Ojeda , Greg KH , Bartosz Golaszewski , Kees Cook , Jan Kara , James Bottomley , Julia Lawall , Laurent Pinchart , Roland Dreier , ksummit@lists.linux.dev, Viresh Kumar Subject: Re: [TECH TOPIC] Rust for Linux Message-ID: References: <20210707203827.GI18396@quack2.suse.cz> Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello, On 19/07/2021 14:15:57+0100, Wedson Almeida Filho wrote: > On Mon, Jul 19, 2021 at 01:24:49PM +0100, Wedson Almeida Filho wrote: > > On Fri, Jul 09, 2021 at 12:13:25AM +0200, Linus Walleij wrote: > > > I have seen that QEMU has a piece of code for the Arm PrimeCell > > > PL061 GPIO block which corresponds to drivers/gpio/gpio-pl061.c > > > Note that this hardware apart from being used in all Arm reference > > > designs is used on ARMv4T systems that are not supported by > > > LLVM but only GCC, which might complicate things. > > > > Here is a working PL061 driver in Rust (converted form the C one): > > https://raw.githubusercontent.com/wedsonaf/linux/pl061/drivers/gpio/gpio_pl061_rust.rs > > I'm also attaching an html rending of the C and Rust versions side by side where > I try to line the definitions up to make it easier to contrast the two > implementations. I'd love to have a side by side disassembly of the generated object files (ideally intermixed with the source). -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com