From patchwork Tue Jan 26 17:10:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 60494 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2091088lbb; Tue, 26 Jan 2016 09:14:41 -0800 (PST) X-Received: by 10.66.222.101 with SMTP id ql5mr35608060pac.144.1453828481003; Tue, 26 Jan 2016 09:14:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ze3si3060698pac.193.2016.01.26.09.14.40; Tue, 26 Jan 2016 09:14:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967188AbcAZROj (ORCPT + 30 others); Tue, 26 Jan 2016 12:14:39 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38462 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967057AbcAZRLg (ORCPT ); Tue, 26 Jan 2016 12:11:36 -0500 Received: by mail-wm0-f47.google.com with SMTP id b14so141819233wmb.1 for ; Tue, 26 Jan 2016 09:11:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RZ1eC+xEx0kZd772KoDrJ90ZlkFbjmO4AIrJPAtqpME=; b=b/G60yp817eB5/+o4PvdgqVsLPSSI9wVvPDFajSLNMpxVj57FmNGbFLpGblKb/cwRf SkmfXX29lY2w54F+aE6t5E0hRDSiYGF7ortX3FJCgAzkS154+/AkzR/zLK8VCxHI/whe w3/Uvt1pvLnNLyzpJTUOLabvM1E1nPGNlRTeA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RZ1eC+xEx0kZd772KoDrJ90ZlkFbjmO4AIrJPAtqpME=; b=Hauy1ROCTXIjK5ezNvvIU5eVAQGDYZF89TWT37HKa1WjhslRLPsMjjifZQOjjLUeHR 5WZoXCzzfZk5SN8W4uv7tjW2pfnEvfwlm0l7Y8rVGIdv9w960mGolgGpWgnysDJtSU+I uf7mq4ga1wOAK4OvyZRk2ZW85PaB90JjaFI2fHk8W2+Ng/ifrH/kODf/Jzk1xseZrR4a WNIgmSK4VPZwmHGlY2avNzxcPOe0XKAYsSE7am5CJTXN2lPBDRmRvmc+753Gv9WqbH99 DE4VQnUrkLjcjkcLjcEE2xnrO3QzlAZru2/16txpDAdZiUEsfaMDbJDhKmYlfOU7Ocpt ytUA== X-Gm-Message-State: AG10YOS7yRBSWYMfB7ClhA/KKy6niwI+EuRRu0ipDuD5YmULKkO+i89zB5158WAw1Xboulm1 X-Received: by 10.28.30.138 with SMTP id e132mr23981474wme.86.1453828295658; Tue, 26 Jan 2016 09:11:35 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id ko2sm2328617wjc.9.2016.01.26.09.11.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jan 2016 09:11:34 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, will.deacon@arm.com, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org, keescook@chromium.org, linux-kernel@vger.kernel.org Cc: stuart.yoder@freescale.com, bhupesh.sharma@freescale.com, arnd@arndb.de, marc.zyngier@arm.com, christoffer.dall@linaro.org, labbott@fedoraproject.org, matt@codeblueprint.co.uk, Ard Biesheuvel Subject: [PATCH v4 14/22] arm64: make asm/elf.h available to asm files Date: Tue, 26 Jan 2016 18:10:41 +0100 Message-Id: <1453828249-14467-15-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453828249-14467-1-git-send-email-ard.biesheuvel@linaro.org> References: <1453828249-14467-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reshuffles some code in asm/elf.h and puts a #ifndef __ASSEMBLY__ around its C definitions so that the CPP defines can be used in asm source files as well. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/elf.h | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) -- 2.5.0 Acked-by: Mark Rutland diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index faad6df49e5b..435f55952e1f 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -24,15 +24,6 @@ #include #include -typedef unsigned long elf_greg_t; - -#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t)) -#define ELF_CORE_COPY_REGS(dest, regs) \ - *(struct user_pt_regs *)&(dest) = (regs)->user_regs; - -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -typedef struct user_fpsimd_state elf_fpregset_t; - /* * AArch64 static relocation types. */ @@ -127,6 +118,17 @@ typedef struct user_fpsimd_state elf_fpregset_t; */ #define ELF_ET_DYN_BASE (2 * TASK_SIZE_64 / 3) +#ifndef __ASSEMBLY__ + +typedef unsigned long elf_greg_t; + +#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t)) +#define ELF_CORE_COPY_REGS(dest, regs) \ + *(struct user_pt_regs *)&(dest) = (regs)->user_regs; + +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +typedef struct user_fpsimd_state elf_fpregset_t; + /* * When the program starts, a1 contains a pointer to a function to be * registered with atexit, as per the SVR4 ABI. A value of 0 means we have no @@ -186,4 +188,6 @@ extern int aarch32_setup_vectors_page(struct linux_binprm *bprm, #endif /* CONFIG_COMPAT */ +#endif /* !__ASSEMBLY__ */ + #endif