lkml.org 
[lkml]   [2011]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] input: Add Nintendo extension controller driver
On Mon, May 16, 2011 at 10:51:10PM +0100, Ben Dooks wrote:
> On Mon, May 16, 2011 at 03:46:08PM -0600, Grant Likely wrote:
> > +
> > + /*
> > + * DMA buffer, with padding to give it its own cache line so that
> > + * the DMA streaming works on non-coherent architectures.
> > + * Question: Is this the proper pattern, and is this really necessary?
> > + */
> > + uint8_t pad1[L1_CACHE_BYTES];
> > + uint8_t buf[6];
> > + uint8_t pad2[L1_CACHE_BYTES];
> > +};
>
> I think there's an attribute to do this, starting with an __ defined
> in the kernel.
>

Yes, it is called "____cacheline_aligned".

--
Dmitry


\
 
 \ /
  Last update: 2011-05-17 00:47    [W:0.049 / U:0.208 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site