[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aB3ocO8xh5GugfDD@smile.fi.intel.com>
Date: Fri, 9 May 2025 14:35:12 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andrew Ballance <andrewjballance@...il.com>
Cc: dakr@...nel.org, airlied@...il.com, simona@...ll.ch,
akpm@...ux-foundation.org, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...nel.org, aliceryhl@...gle.com,
tmgross@...ch.edu, gregkh@...uxfoundation.org, rafael@...nel.org,
bhelgaas@...gle.com, kwilczynski@...nel.org, raag.jadav@...el.com,
arnd@...db.de, me@...enk.dev, fujita.tomonori@...il.com,
daniel.almeida@...labora.com, nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH 06/11] io: move PIO_OFFSET to linux/io.h
On Thu, May 08, 2025 at 10:15:19PM -0500, Andrew Ballance wrote:
> From: Fiona Behrens <me@...enk.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
Powered by blists - more mailing lists