From patchwork Tue Aug 30 11:45:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 112262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7A85BB6F83 for ; Tue, 30 Aug 2011 21:45:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 161BB280A7; Tue, 30 Aug 2011 13:45:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zAJM5UiZ1bqS; Tue, 30 Aug 2011 13:45:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61A73280AA; Tue, 30 Aug 2011 13:45:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74DB7280AA for ; Tue, 30 Aug 2011 13:45:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aNB8qsXkSO6g for ; Tue, 30 Aug 2011 13:45:33 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by theia.denx.de (Postfix) with ESMTP id B99BB280A7 for ; Tue, 30 Aug 2011 13:45:32 +0200 (CEST) Received: from euspt2 (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0LQQ0092TONSZG@mailout2.w1.samsung.com> for u-boot@lists.denx.de; Tue, 30 Aug 2011 12:45:28 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LQQ00MH7ONR9Y@spt2.w1.samsung.com> for u-boot@lists.denx.de; Tue, 30 Aug 2011 12:45:28 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 466E527004A; Tue, 30 Aug 2011 13:46:47 +0200 (CEST) Date: Tue, 30 Aug 2011 13:45:18 +0200 From: Lukasz Majewski In-reply-to: <1314261435-29789-1-git-send-email-l.majewski@samsung.com> To: u-boot@lists.denx.de Message-id: <1314704718-26385-1-git-send-email-l.majewski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.5.4 References: <1314261435-29789-1-git-send-email-l.majewski@samsung.com> Cc: Anton Staaf , Kyungmin Park , m.szyprowski@samsung.com Subject: [U-Boot] [PATCH v2] dcache: Dcache line size aligned stack buffer allocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de ALLOC_CACHE_ALIGN_BUFFER shall be used in functions, which are using stack allocated buffers for DMA transfers. Signed-off-by: Lukasz Majewski Signed-off-by: Kyungmin Park CC: Albert ARIBAUD --- 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]; \ + 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