lkml.org 
[lkml]   [2008]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: usb_get_status(): what a weird implementation !
Date
Am Montag 30 Juni 2008 14:41:37 schrieb Francis Moreau:
> On Mon, Jun 30, 2008 at 1:46 PM, Oliver Neukum <oliver@neukum.org> wrote:
> > Am Montag 30 Juni 2008 13:04:21 schrieb Francis Moreau:

> >> well, it wouldn't be hard to allocated a buf on the stack with correct
> >> alignement
> >> and size for DMA mapping.
> >
> > Where would you put it and meet the alignment requirements?
> >
>
> wouldn't this code below do the trick ?
>
> void foo(void)
> {
> unsigned char __buf[2 * CACHE_LINE_SIZE];
> unsigned char *buf;
>
> buf = ((unsigned long)__buf) + CACHE_LINE_SIZE-1) & ~(CACHE_LINE_SIZE-1);
> }
>
> but I agree it looks hackish.

If your buffer is smaller than CACHE_LINE_SIZE it should work.
However, this needs input from people who understand DMA in and out.
But how large is 2 * CACHE_LINE_SIZE compared to the kernel stack?

Regards
Oliver


\
 
 \ /
  Last update: 2008-06-30 15:53    [W:0.053 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site