[PATCH 06/11] io: move PIO_OFFSET to linux/io.h
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Fri May 9 11:35:12 UTC 2025
On Thu, May 08, 2025 at 10:15:19PM -0500, Andrew Ballance wrote:
> From: Fiona Behrens <me at kloenk.dev>
>
> Move the non arch specific PIO size to linux/io.h.
>
> This allows rust to access `PIO_OFFSET`, `PIO_MASK` and
> `PIO_RESERVED`. This is required to implement `IO_COND` in rust.
...
> +/*
> + * We encode the physical PIO addresses (0-0xffff) into the
I know this is the original text, but we have a chance to improve it a bit by
saying range more explicitly:
* We encode the physical PIO addresses (0x0000-0xffff) into the
> + * pointer by offsetting them with a constant (0x10000) and
> + * assuming that all the low addresses are always PIO. That means
> + * we can do some sanity checks on the low bits, and don't
> + * need to just take things for granted.
> + */
> +#define PIO_OFFSET 0x10000UL
> +#define PIO_MASK 0x0ffffUL
> +#define PIO_RESERVED 0x40000UL
> +#endif
--
With Best Regards,
Andy Shevchenko
More information about the Nouveau
mailing list