From patchwork Tue Jun 14 10:58:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot for Dave Martin X-Patchwork-Id: 878812 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5EAx2Y4020712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Jun 2011 10:59:23 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QWRKi-0001Wc-4n; Tue, 14 Jun 2011 10:58:56 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QWRKh-0002N2-KN; Tue, 14 Jun 2011 10:58:55 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QWRKM-0002Ij-Ay for linux-arm-kernel@lists.infradead.org; Tue, 14 Jun 2011 10:58:35 +0000 Received: by wyb28 with SMTP id 28so5146737wyb.36 for ; Tue, 14 Jun 2011 03:58:33 -0700 (PDT) Received: by 10.227.55.74 with SMTP id t10mr6279012wbg.91.1308049112930; Tue, 14 Jun 2011 03:58:32 -0700 (PDT) Received: from e200948.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id c17sm4938057wbh.29.2011.06.14.03.58.31 (version=SSLv3 cipher=OTHER); Tue, 14 Jun 2011 03:58:32 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 1/5] ARM: mm: Add generic proc/arch struct definition macros Date: Tue, 14 Jun 2011 11:58:21 +0100 Message-Id: <1308049105-16080-2-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1308049105-16080-1-git-send-email-dave.martin@linaro.org> References: <1308049105-16080-1-git-send-email-dave.martin@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110614_065834_519829_30A6B4ED X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 14 Jun 2011 10:59:23 +0000 (UTC) This patch adds some generic macros to reduce boilerplate when declaring certain common structures in arch/arm/mm/*.S Thanks to Russell King for outlining what the define_processor_functions macro could look like. Signed-off-by: Dave Martin --- arch/arm/mm/proc-macros.S | 79 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 79 insertions(+), 0 deletions(-) diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index 34261f9..3c5ffbb 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S @@ -4,6 +4,7 @@ * VMA_VM_FLAGS * VM_EXEC */ +#include #include #include @@ -254,3 +255,81 @@ mcr p15, 0, r0, c7, c10, 1 @ clean L1 D line mcr p15, 0, ip, c7, c10, 4 @ data write barrier .endm + +.macro define_processor_functions name:req, dabort:req, pabort:req, nommu=0, suspend=0 + .pushsection .text + + __INITDATA + + .type \name\()_processor_functions, #object + +ENTRY(\name\()_processor_functions) + .word \dabort\()_abort + .word \pabort\()_pabort + .word cpu_\name\()_proc_init + .word cpu_\name\()_proc_fin + .word cpu_\name\()_reset + .word cpu_\name\()_do_idle + .word cpu_\name\()_dcache_clean_area + .word cpu_\name\()_switch_mm + + .if \nommu + .word 0 + .else + .word cpu_\name\()_set_pte_ext + .endif + + .if \suspend + .word cpu_\name\()_suspend_size + .word cpu_\name\()_do_suspend + .word cpu_\name\()_do_resume + .else + .word 0 + .word 0 + .word 0 + .endif + + .size \name\()_processor_functions, . - \name\()_processor_functions + + .popsection +.endm + +.macro define_proc_names name:req, arch:req, elf:req, cpu:req + .pushsection .rodata.str, "aMS", 1 + + .type \name\()_arch_name, #object +\name\()_arch_name: .asciz "\arch" + .size \name\()_arch_name, . - \name\()_arch_name + + .type \name\()_elf_name, #object +\name\()_elf_name: .asciz "\elf" + .size \name\()_elf_name, . - \name\()_elf_name + + .type \name\()_cpu_name, #object +\name\()_cpu_name: .asciz "\cpu" + .size \name\()_cpu_name, . - \name\()_cpu_name + + .popsection +.endm + +.macro define_cache_functions name:req + .pushsection .text + + __INITDATA + + .type \name\()_cache_fns, #object +ENTRY(\name\()_cache_fns) + .long \name\()_flush_icache_all + .long \name\()_flush_kern_cache_all + .long \name\()_flush_user_cache_all + .long \name\()_flush_user_cache_range + .long \name\()_coherent_kern_range + .long \name\()_coherent_user_range + .long \name\()_flush_kern_dcache_area + .long \name\()_dma_map_area + .long \name\()_dma_unmap_area + .long \name\()_dma_flush_range + .size \name\()_cache_fns, . - \name\()_cache_fns + + .popsection +.endm