lkml.org 
[lkml]   [1999]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: user space writel() etc. in 2.2.2
From
Date
>>>>> "Alan" == Alan Cox <alan@lxorguk.ukuu.org.uk>:
>> Besides, why i386/io.h does not know anything about writel() in non
>> __KERNEL__ , whereas alpha/io.h declares them as extern. That sure
>> is inconsitent.
Alan> Because its non portable.

>> On the other hand - WHY one loses portability doing IO memory access
>> on different architectures? Sure enough that PCI memory would be
>> present on any architecture that has that PCI plugged in, and
>> registers would be the same (though ordering might differ, and that
>> is the responsibility of writel() etc. to handle it.

Alan> Does the bus reverse the bytes in the long words, does it do PCI
Alan> posting, how is I/O space mapped - memory, I/O instructions, are
Alan> different size or endian mappings present at different offsets.

Alan> Then you can add write posting, cache coherency and the like.

Ok, then what IS the proper way of accessing the PCI mem space? There
are some drivers (drivers/net/dgrs.c for instance) that just do:

ulong *ptr = ioremap(physaddr, 256);
ptr[3] = something;

Others use writel()/readl(), some define their own macros. Is there a
One True Way?

Does one need to worry about caching and cache flushing in case of PCI
mem space? Is that architecture dependent?

--J.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.077 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site