From patchwork Wed Feb 10 22:15:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 8274991 Return-Path: X-Original-To: patchwork-linux-kbuild@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 300CCBEEE5 for ; Wed, 10 Feb 2016 22:15:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3EA9620379 for ; Wed, 10 Feb 2016 22:15:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F51A2034C for ; Wed, 10 Feb 2016 22:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750928AbcBJWPK (ORCPT ); Wed, 10 Feb 2016 17:15:10 -0500 Received: from relais.videotron.ca ([24.201.245.36]:24910 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750816AbcBJWPJ (ORCPT ); Wed, 10 Feb 2016 17:15:09 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from yoda.home ([96.23.157.65]) by VL-VM-MR005.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0O2C00FRRR57K6D0@VL-VM-MR005.ip.videotron.ca>; Wed, 10 Feb 2016 17:15:07 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id B15752DA0465; Wed, 10 Feb 2016 17:15:07 -0500 (EST) Date: Wed, 10 Feb 2016 17:15:07 -0500 (EST) From: Nicolas Pitre To: Al Viro Cc: linux-arch@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 02/13] EXPORT_SYMBOL() for asm In-reply-to: <1454534445-16759-2-git-send-email-viro@ZenIV.linux.org.uk> Message-id: References: <20160203211953.GT17997@ZenIV.linux.org.uk> <1454534445-16759-2-git-send-email-viro@ZenIV.linux.org.uk> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 On Wed, 3 Feb 2016, Al Viro wrote: > From: Al Viro > > Add asm-usable variants of EXPORT_SYMBOL/EXPORT_SYMBOL_GPL. This > commit just adds the default implementation; most of the architectures > can simply add export.h to asm/Kbuild and start using > from assembler. The rest needs to have their define > everal macros and then explicitly include [...] FYI, here's the needed changes to make it work with my autoksyms series. This is the asm/export.h version of http://lkml.org/lkml/2016/2/10/5. --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/asm-generic/export.h b/include/asm-generic/export.h index 03b51ac4cc..b450da9d68 100644 --- a/include/asm-generic/export.h +++ b/include/asm-generic/export.h @@ -59,8 +59,24 @@ KSYM(__kcrctab_\name): #endif .endm #undef __put -#define EXPORT_SYMBOL(name) __EXPORT_SYMBOL name,KSYM_FUNC(KSYM(name)) -#define EXPORT_SYMBOL_GPL(name) __EXPORT_SYMBOL name,KSYM_FUNC(KSYM(name)),_gpl -#define EXPORT_DATA_SYMBOL(name) __EXPORT_SYMBOL name,KSYM(name) -#define EXPORT_DATA_SYMBOL_GPL(name) __EXPORT_SYMBOL name,KSYM(name),_gpl + +#ifdef CONFIG_TRIM_UNUSED_KSYMS +#include +#include +#define ___EXPORT_SYMBOL(name, val, sec) \ + __cond_export_sym(name, val, sec, config_enabled(__KSYM_##name)) +#define __cond_export_sym(name, val, sec, conf) \ + ___cond_export_sym(name, val, sec, conf) +#define ___cond_export_sym(name, val, sec, enabled) \ + __cond_export_sym_##enabled(name, val, sec) +#define __cond_export_sym_1(name, val, sec) __EXPORT_SYMBOL name, val, sec +#define __cond_export_sym_0(name, val, sec) /* nothing */ +#else +#define ___EXPORT_SYMBOL(name, val, sec) __EXPORT_SYMBOL name, val, sec +#endif + +#define EXPORT_SYMBOL(name) ___EXPORT_SYMBOL(name,KSYM_FUNC(KSYM(name)),()) +#define EXPORT_SYMBOL_GPL(name) ___EXPORT_SYMBOL(name,KSYM_FUNC(KSYM(name)),_gpl) +#define EXPORT_DATA_SYMBOL(name) ___EXPORT_SYMBOL(name,KSYM(name),()) +#define EXPORT_DATA_SYMBOL_GPL(name) ___EXPORT_SYMBOL(name,KSYM(name),_gpl) #endif