From: Oliver Neukum <oliver@neukum.org>
To: "Francis Moreau" <francis.moro@gmail.com>
Cc: "David Brownell" <david-b@pacbell.net>,
linux-usb@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: usb_get_status(): what a weird implementation !
Date: Mon, 30 Jun 2008 15:51:41 +0200 [thread overview]
Message-ID: <200806301551.42252.oliver@neukum.org> (raw)
In-Reply-To: <38b2ab8a0806300541q756e9b6fl445a5ee69d403ce7@mail.gmail.com>
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
next parent reply other threads:[~2008-06-30 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200806261011.00287.oliver@neukum.org>
[not found] ` <200806301346.11267.oliver@neukum.org>
[not found] ` <38b2ab8a0806300541q756e9b6fl445a5ee69d403ce7@mail.gmail.com>
2008-06-30 13:51 ` Oliver Neukum [this message]
2008-06-30 14:03 ` Francis Moreau
2008-06-30 14:11 ` Oliver Neukum
2008-06-30 14:22 ` Francis Moreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806301551.42252.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=david-b@pacbell.net \
--cc=francis.moro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®