From patchwork Wed Jan 12 00:02:30 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: 472881 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0C02tOg015082 for ; Wed, 12 Jan 2011 00:02:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932703Ab1ALACs (ORCPT ); Tue, 11 Jan 2011 19:02:48 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:37367 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932697Ab1ALACr (ORCPT ); Tue, 11 Jan 2011 19:02:47 -0500 Received: by ywl5 with SMTP id 5so4024ywl.19 for ; Tue, 11 Jan 2011 16:02:47 -0800 (PST) Received: by 10.90.248.28 with SMTP id v28mr802162agh.168.1294790566893; Tue, 11 Jan 2011 16:02:46 -0800 (PST) Received: from LinaroE102765 ([63.133.153.66]) by mx.google.com with ESMTPS id c30sm75903anc.0.2011.01.11.16.02.45 (version=SSLv3 cipher=RC4-MD5); Tue, 11 Jan 2011 16:02:45 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: Jean Pihet , linux-omap@vger.kernel.org Subject: [PATCH 0/0] RFC: ARM: Thumb-2: Symbol manipulation macros for function body copying Date: Tue, 11 Jan 2011 18:02:30 -0600 Message-Id: <1294790551-17069-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 12 Jan 2011 00:02:56 +0000 (UTC) diff --git a/arch/arm/include/asm/unified.h b/arch/arm/include/asm/unified.h index bc63116..636a765 100644 --- a/arch/arm/include/asm/unified.h +++ b/arch/arm/include/asm/unified.h @@ -24,6 +24,32 @@ .syntax unified #endif +#ifndef __ASSEMBLY__ +#include +#define __funcp_to_uint(funcp) ({ \ + uintptr_t __result; \ + \ + asm("" : "=r" (__result) : "0" (funcp)); \ + __result; \ + }) +#define __uint_to_funcp(i, funcp) ({ \ + typeof(funcp) __result; \ + \ + asm("" : "=r" (__result) : "0" (i)); \ + __result; \ + }) +#define FSYM_REBASE(funcp, dest_buf) \ + __uint_to_funcp((uintptr_t)(dest_buf) | FSYM_TYPE(funcp), funcp) + +#ifdef CONFIG_THUMB2_KERNEL +#define FSYM_BASE(funcp) ((void *)(__funcp_to_uint(funcp) & ~(uintptr_t)1)) +#define FSYM_TYPE(funcp) (__funcp_to_uint(funcp) & 1) +#else /* !CONFIG_THUMB2_KERNEL */ +#define FSYM_BASE(funcp) ((void *)__funcp_to_uint(funcp)) +#define FSYM_TYPE(funcp) 0 +#endif /* !CONFIG_THUMB2_KERNEL */ +#endif /* !__ASSEMBLY__ */ + #ifdef CONFIG_THUMB2_KERNEL #if __GNUC__ < 4