From patchwork Fri Feb 19 13:45:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 8361341 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6E12C0553 for ; Fri, 19 Feb 2016 13:48:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFD082045B for ; Fri, 19 Feb 2016 13:48:43 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B6CD20443 for ; Fri, 19 Feb 2016 13:48:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWlNy-00021p-PE; Fri, 19 Feb 2016 13:46:18 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aWlNx-00020d-6v for xen-devel@lists.xensource.com; Fri, 19 Feb 2016 13:46:17 +0000 Received: from [193.109.254.147] by server-11.bemta-14.messagelabs.com id D9/60-28228-8AC17C65; Fri, 19 Feb 2016 13:46:16 +0000 X-Env-Sender: mcgrof@kernel.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1455889574!25113595!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21622 invoked from network); 19 Feb 2016 13:46:15 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-16.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 19 Feb 2016 13:46:15 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A137420494; Fri, 19 Feb 2016 13:46:13 +0000 (UTC) Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0AA54204AB; Fri, 19 Feb 2016 13:46:12 +0000 (UTC) From: "Luis R. Rodriguez" To: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Date: Fri, 19 Feb 2016 05:45:56 -0800 Message-Id: <1455889559-9428-5-git-send-email-mcgrof@kernel.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455889559-9428-1-git-send-email-mcgrof@kernel.org> References: <1455889559-9428-1-git-send-email-mcgrof@kernel.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: benh@kernel.crashing.org, ming.lei@canonical.com, masami.hiramatsu.pt@hitachi.com, linux-arch@vger.kernel.org, xen-devel@lists.xensource.com, linux@arm.linux.org.uk, x86@kernel.org, anil.s.keshavamurthy@intel.com, arnd@arndb.de, rusty@rustcorp.com.au, jbaron@akamai.com, boris.ostrovsky@oracle.com, andriy.shevchenko@linux.intel.com, mcb30@ipxe.org, jgross@suse.com, ananth@in.ibm.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, luto@amacapital.net, "Luis R. Rodriguez" , david.vrabel@citrix.com, dwmw2@infradead.org, davem@davemloft.net Subject: [Xen-devel] [RFC v2 4/7] asm/sections: add a generic push_section_tbl() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Virus-Scanned: ClamAV using ClamSMTP With a generic linker tables solution in place we need a general asm solution for declaring entries with asm. The first easy target is to cover the C asm declarations, guard the header file for now and define a first generic entry push_section_tbl() to be used later for custom linker table annotations. Signed-off-by: Luis R. Rodriguez --- include/asm-generic/sections.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index af0254c09424..f5ea98bd85d2 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -3,8 +3,10 @@ /* References to section boundaries */ +#ifndef __ASSEMBLY__ #include #include +#include /* * Usage guidelines: @@ -128,4 +130,12 @@ static inline bool init_section_intersects(void *virt, size_t size) return memory_intersects(__init_begin, __init_end, virt, size); } +/* + * Some architectures do not like the "\t" at the end (s39), we should be + * able to generalize this further, but so far this covers most architectures. + */ +#define push_section_tbl(section, name, level, flags) \ + ".pushsection " SECTION_TBL(section,name,level) ", \"" #flags "\"\n\t" +#endif + #endif /* _ASM_GENERIC_SECTIONS_H_ */