Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp218404pxb; Tue, 31 Aug 2021 19:39:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynbrULilWrJMN3XJb2SXO7hReZjFOtOOt2kggYBbYhyr5gEbST7k97xXMMs3dfnDOdEp5v X-Received: by 2002:a05:6e02:1526:: with SMTP id i6mr22022607ilu.74.1630463963633; Tue, 31 Aug 2021 19:39:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630463963; cv=none; d=google.com; s=arc-20160816; b=LoxvfS/izrXNc39irp8jMCM/GjRcxrfoqwDMZG091p+6qa3Xnpp7FpkIXlIxBkwL6E 7BbqK5bLbwEmkC2EatxAg3tAxF/iEZRit0Xx2MMtL5TKgtvsenc6Mb6T5uWekcLPZxYc 4n6JHgRQFz0EGrrrEs1OyH38ldVeoeUMiaJEiGfG9YKvf1W/0Gjmn4vtBYHH6FCvC15N VyU/lqLNocI6CGXyFFui6KQIrhPZ0sbHck1PQ09kh4z7toAFkcjVU2TY4WuKJ5rKGcez Zi4TfvTd1+EmsSJqT1G3Oh+Fn7PNCeBm9aaN4sdqBQjH0prAb+MB39wcxzVeL7P+97GL R9qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HarwfxFDej3iz+R++B2u5RuC8GY20r94agGqutBst+0=; b=NuTuXJDSMFoMpm01rKZfe1RZjDoTXtPSQ4kywn+rBOxZicBwecaXCs9Oblx6UEYL84 v6El1IPwFIuPS1Uo3LWOigPTKzAJogo8fqS/bkhUpbw065cBQZmgRmVwUcfgJMIcnQxx b8U8EpGpjEcHqogL0DkeU1yDnQ9uh/lXiMIEtiRo2KRAbu4a5XbrastfjZEMULoJNe4O BmgOY7B+GZlww4/oMK3V0mUk7c9fQBDJH5Y3M/Wk46u8L0lS+O2vb+UKRanloGwJZgeh IyislHMcJ1PGxejggrUuXlA/xokrJ7weVmRpliThvVq1jTzCySqjVO1Lpyf17iwerBE+ hLJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si19453149ilq.88.2021.08.31.19.39.12; Tue, 31 Aug 2021 19:39:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241730AbhIACjJ (ORCPT + 99 others); Tue, 31 Aug 2021 22:39:09 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:15278 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241726AbhIACjI (ORCPT ); Tue, 31 Aug 2021 22:39:08 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4GzpBN4tycz8D5H; Wed, 1 Sep 2021 10:37:48 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 1 Sep 2021 10:38:02 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm000001.china.huawei.com (7.185.36.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 1 Sep 2021 10:38:01 +0800 From: Tong Tiangen To: Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou , CC: , Subject: [PATCH -next v3 1/3] riscv/vdso: Refactor asm/vdso.h Date: Wed, 1 Sep 2021 02:46:19 +0000 Message-ID: <20210901024621.2528797-2-tongtiangen@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20210901024621.2528797-1-tongtiangen@huawei.com> References: <20210901024621.2528797-1-tongtiangen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm000001.china.huawei.com (7.185.36.245) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The asm/vdso.h will be included in vdso.lds.S in the next patch, the following cleanup is needed to avoid syntax error: 1.the declaration of sys_riscv_flush_icache() is moved into asm/syscall.h. 2.the definition of struct vdso_data is moved into kernel/vdso.c. 2.the definition of VDSO_SYMBOL is placed under "#ifndef __ASSEMBLY__". Also remove the redundant linux/types.h include. Signed-off-by: Tong Tiangen --- arch/riscv/include/asm/syscall.h | 1 + arch/riscv/include/asm/vdso.h | 13 ++++--------- arch/riscv/kernel/syscall_table.c | 1 - arch/riscv/kernel/vdso.c | 5 ++++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h index b933b1583c9f..34fbb3ea21d5 100644 --- a/arch/riscv/include/asm/syscall.h +++ b/arch/riscv/include/asm/syscall.h @@ -82,4 +82,5 @@ static inline int syscall_get_arch(struct task_struct *task) #endif } +asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); #endif /* _ASM_RISCV_SYSCALL_H */ diff --git a/arch/riscv/include/asm/vdso.h b/arch/riscv/include/asm/vdso.h index 893e47195e30..8a49f8ecfb52 100644 --- a/arch/riscv/include/asm/vdso.h +++ b/arch/riscv/include/asm/vdso.h @@ -8,26 +8,21 @@ #ifndef _ASM_RISCV_VDSO_H #define _ASM_RISCV_VDSO_H - /* * All systems with an MMU have a VDSO, but systems without an MMU don't * support shared libraries and therefor don't have one. */ #ifdef CONFIG_MMU -#include -#include +#ifndef __ASSEMBLY__ -#ifndef CONFIG_GENERIC_TIME_VSYSCALL -struct vdso_data { -}; -#endif +#include #define VDSO_SYMBOL(base, name) \ (void __user *)((unsigned long)(base) + __vdso_##name##_offset) -#endif /* CONFIG_MMU */ +#endif /* !__ASSEMBLY__ */ -asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); +#endif /* CONFIG_MMU */ #endif /* _ASM_RISCV_VDSO_H */ diff --git a/arch/riscv/kernel/syscall_table.c b/arch/riscv/kernel/syscall_table.c index a63c667c27b3..44b1420a2270 100644 --- a/arch/riscv/kernel/syscall_table.c +++ b/arch/riscv/kernel/syscall_table.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #undef __SYSCALL diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index 25a3b8849599..72e93d218335 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -12,10 +12,13 @@ #include #include #include +#include + #ifdef CONFIG_GENERIC_TIME_VSYSCALL #include #else -#include +struct vdso_data { +}; #endif extern char vdso_start[], vdso_end[]; -- 2.18.0.huawei.25