From patchwork Wed Sep 27 17:06:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13401435 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FBD9E82CAE for ; Wed, 27 Sep 2023 17:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=c9uRwSXMEXdqDo2GQ9KMbdKMXlTxxqdpZIQDzCVyVVM=; b=N0YRhQan6kMixb x4vpM5lXMG7h6nU9NtzlTGXg1ich+AKuRUKEJAW0MvhTtI3xZ3WF58RbrB0oyFXWC0exqtvLJWGXZ TqL8uTbNMYcZsJ+6GxPbBkeIwyiPX4T8nqgbW70av5zBpEYB0oYycYE7NuP2IDIs+wXke8SVZAdHi uNyfpX0WL6kY8kSLkqIZZibTgKqWoxl8wgbcSPv5us695e14AQaOYLN+Fh8f7+qrqs8H3E4o797Qd EIY3OJrYOFHwC5dFB5wPVZjV14yCOTosZsShyHVEL3Wm8Rhi8F9Gi7OtDiY5OtXnRPBijw7RrXdaD tS4XMHe3JlQryr4unXmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlXzL-001Tx4-33; Wed, 27 Sep 2023 17:06:15 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlXzJ-001Twb-09 for linux-arm-kernel@lists.infradead.org; Wed, 27 Sep 2023 17:06:14 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id E5342B81819; Wed, 27 Sep 2023 17:06:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1830FC433CA; Wed, 27 Sep 2023 17:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695834370; bh=+UG/yWZqZo1iV8TUQE3qhdJF0S1Q3YjrzyQjZVd6NL0=; h=From:To:Cc:Subject:Date:From; b=Qdfg391W2W7NBMk+m/EKVEc4PsWoYHrPd94/b7LiJLUlRCDPTFoJAq+2Ka3b9Blhf 45CmO9z2n7DEOGLXApOAnZ2gUZ2+8B1zF6dqIUmbkpyTaq5cSvTofUNxgGt5orqHsE RcM28LrsljFT1hdyyDuVn9f3G9JEajNh8ZTx5Yadl0IT1wJ209uJa69+R324nBzKgk n6u31bLwSv+SrbrlPc9VyCfNcCn3yrololUBn4y58e4Aor0/NosIGwmMlThKmzaOmY EW+z8ksqq1DVLgr02f3JuA6c7q6eMTEVVQW5qSVfJZ2fRnf1rYozlWD+DGYX49CS0D aVroXOfNICTjw== From: Masahiro Yamada To: patches@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, Russell King , Masahiro Yamada , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: make self-contained for ARM Date: Thu, 28 Sep 2023 02:06:00 +0900 Message-Id: <20230927170600.286183-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230927_100613_245877_D80B04AF X-CRM114-Status: GOOD ( 12.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When I compiled the following code for ARM, I encountered numerous errors. [Test Code] #include #include int foo(int *x, int __user *ptr) { return get_user(*x, ptr); } To fix the errors, make some asm headers self-contained: 1. In arch/arm/include/asm/domain.h, include for current_thread_info(). 2. In arch/arm/include/asm/traps.h, remove unneeded __init, and include for asmlinkage. 3. In arch/arm/include/asm/uaccess.h, include for might_fault(). Signed-off-by: Masahiro Yamada --- KernelVersion: v6.6-rc1 arch/arm/include/asm/domain.h | 2 +- arch/arm/include/asm/traps.h | 3 ++- arch/arm/include/asm/uaccess.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index 41536feb4392..d48859fdf32c 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h @@ -8,8 +8,8 @@ #define __ASM_PROC_DOMAIN_H #ifndef __ASSEMBLY__ +#include #include -#include #endif /* diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h index 0aaefe3e1700..2621b9fb9b19 100644 --- a/arch/arm/include/asm/traps.h +++ b/arch/arm/include/asm/traps.h @@ -2,6 +2,7 @@ #ifndef _ASMARM_TRAP_H #define _ASMARM_TRAP_H +#include #include struct pt_regs; @@ -28,7 +29,7 @@ static inline int __in_irqentry_text(unsigned long ptr) ptr < (unsigned long)&__irqentry_text_end; } -extern void __init early_trap_init(void *); +extern void early_trap_init(void *); extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame, const char *loglvl); extern void ptrace_break(struct pt_regs *regs); diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index bb5c81823117..6a2cc57f015a 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -8,6 +8,7 @@ /* * User space memory access functions */ +#include #include #include #include