All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Staaf <robotboy@google.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] dcache: Dcache line size aligned stack buffer allocation
Date: Tue, 30 Aug 2011 10:15:38 -0700	[thread overview]
Message-ID: <CAF6FioVw2bywXHrAU=QDc+gpgj06dFHBQARoqxzZU3T+2oiZOQ@mail.gmail.com> (raw)
In-Reply-To: <1314704718-26385-1-git-send-email-l.majewski@samsung.com>

On Tue, Aug 30, 2011 at 4:45 AM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> ALLOC_CACHE_ALIGN_BUFFER shall be used in functions, which are using
> stack allocated buffers for DMA transfers.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Changes for v2:
> ? ? ? ?- ./include/cache.h has been removed and replaced with
> ? ? ? ?simpler macro added to ./include/common.h
> ---
> ?include/common.h | ? ?5 +++++
> ?1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/include/common.h b/include/common.h
> index 12a1074..5bc3af8 100644
> --- a/include/common.h
> +++ b/include/common.h
> @@ -767,6 +767,11 @@ int cpu_release(int nr, int argc, char * const argv[]);
> ?#define ALIGN(x,a) ? ? ? ? ? ? __ALIGN_MASK((x),(typeof(x))(a)-1)
> ?#define __ALIGN_MASK(x,mask) ? (((x)+(mask))&~(mask))
>
> +#define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) \
> + ? ? ? char *__##name[size + CONFIG_SYS_CACHELINE_SIZE]; \

This should be a "char" array, not a "char *" array.  And the size
should be "size + CONFIG_SYS_CACHELINE_SIZE - 1".

Thanks,
    Anton

> + ? ? ? type *name = ALIGN(((typeof(CONFIG_SYS_CACHELINE_SIZE))(__##name)),\
> + ? ? ? ? ? ? ? ? ? ? ? ? ?(CONFIG_SYS_CACHELINE_SIZE));
> +
> ?/* Pull in stuff for the build system */
> ?#ifdef DO_DEPS_ONLY
> ?# include <environment.h>
> --
> 1.7.2.3
>
>

  reply	other threads:[~2011-08-30 17:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25  8:37 [U-Boot] [PATCH] dcache: Dcache line size aligned stack buffer allocation Lukasz Majewski
2011-08-25  9:34 ` Wolfgang Denk
2011-08-30 15:44   ` Mike Frysinger
2011-08-30 17:14     ` Anton Staaf
2011-09-01 11:13     ` Aneesh V
2011-09-01 14:35       ` Mike Frysinger
2011-08-30 11:45 ` [U-Boot] [PATCH v2] " Lukasz Majewski
2011-08-30 17:15   ` Anton Staaf [this message]
2011-09-01 10:30 ` [U-Boot] [PATCH v4] " Lukasz Majewski
2011-09-02 23:29   ` Anton Staaf

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='CAF6FioVw2bywXHrAU=QDc+gpgj06dFHBQARoqxzZU3T+2oiZOQ@mail.gmail.com' \
    --to=robotboy@google.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.