2006-09-07 14:41:48

by Rolf Eike Beer

[permalink] [raw]
Subject: ioread64()?

Hi,

I'm looking for a way to access 64 or 128 bit of device space in a single
access. For smaller accesses I use ioread32() and friends. But which way
should I do it for the next bigger accesses? Casting the iospace to something
like u64* looks very suspicious to me. Any better ideas?

Greetings,

Eike


Attachments:
(No filename) (308.00 B)
(No filename) (189.00 B)
Download all attachments

2006-09-07 23:24:10

by Robert Hancock

[permalink] [raw]
Subject: Re: ioread64()?

Rolf Eike Beer wrote:
> Hi,
>
> I'm looking for a way to access 64 or 128 bit of device space in a single
> access. For smaller accesses I use ioread32() and friends. But which way
> should I do it for the next bigger accesses? Casting the iospace to something
> like u64* looks very suspicious to me. Any better ideas?
>
> Greetings,
>
> Eike

There's no portable way to do this as far as I'm aware, for the likely
reason that on many architectures it's impossible to do it in one access..

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from [email protected]
Home Page: http://www.roberthancock.com/

2006-09-13 20:34:59

by Arnd Bergmann

[permalink] [raw]
Subject: Re: ioread64()?

Am Friday 08 September 2006 01:23 schrieb Robert Hancock:
> > I'm looking for a way to access 64 or 128 bit of device space in a single
> > access. For smaller accesses I use ioread32() and friends. But which way
> > should I do it for the next bigger accesses? Casting the iospace to
> > something like u64* looks very suspicious to me. Any better ideas?
>
> There's no portable way to do this as far as I'm aware, for the likely
> reason that on many architectures it's impossible to do it in one access..

Jan-Bernd has stumbled over this as well. There is some hardware that
actually requires atomic 64 bit accesses and is only available on 64 bit
systems, and not for PCI devices.

I'd prefer to have an ioread64 function that is only provided on CONFIG_64BIT
systems, which will mean that any driver using it needs to depend on that
option in Kconfig.

As an alternative, you can already use the readq() function that some
architectures provide. Since linux doesn't run on 128 bit architectures,
you will not see one that can do an atomic read of that size.

Arnd <><