Re: [RFC PATCH 10/11] rust: add basic abstractions for iomem operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Mon, 20 May 2024 at 23:07, Dave Airlie <airlied@xxxxxxxxx> wrote:
> >
> > Wedson wrote a similar abstraction in the past
> > (`rust/kernel/` in the old `rust` branch), with a
> > compile-time `SIZE` -- it is probably worth taking a look.
> >
> Just on this point, we can't know in advance what size the IO BARs are
> at compile time.
> The old method just isn't useful for real devices with runtime IO BAR sizes.

The compile-time `SIZE` in my implementation is a minimum size.

Attempts to read/write with constants within that size (offset + size)
were checked at compile time, that is, they would have zero additional
runtime cost when compared to C. Reads/writes beyond the minimum would
have to be checked at runtime.

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux