Re: [TECH TOPIC] Rust for Linux

Wedson Almeida Filho
2021-07-19T13:16:03Z

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

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.

[-- Attachment #2: pl061.html --]
[-- Type: text/html, Size: 127606 bytes --]