Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1436825pxb; Fri, 20 Aug 2021 05:43:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuxn1PJw+JwjXN2L93ZTN+atqYV/H0ksO6/z9qvr64ez5hWJsgJwoZhs8sMyt61yhJRCkT X-Received: by 2002:a92:c151:: with SMTP id b17mr11076711ilh.1.1629463397532; Fri, 20 Aug 2021 05:43:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629463397; cv=none; d=google.com; s=arc-20160816; b=IvI1f9oJhX8xg31rJcqE8JniV5KcgnJjRmdzLHfnTPEZU+IWyS0+8qL5hRa6e3+NZr ueDyzHEAaMOe8FZDo5d46wUWz/qaqz1CG74NbwLy3jhcI05soohXWXhHfn0rNe/G9Y44 io2HREuA5SQhrscMNT76J0nxfTvA3ZHPFqX7IauF2oOfY+ZJxRT2RZeuMgfBv5syuk9y nsFPm3fmYKdWshdJZLTkq7sdOe4k/cH5AALC2ogXLjX7bGm/x1wS7H/Ipgvxd9aXkSsn SHAuxCILg+gaU/HlPG0G9rHJ3zp0J+bvEDXMDv0a8dhiCvVrX3C5aYdy0IGFvhKYR6ZC rApA== 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=p+uHLXA4MocTTYyTV21HIdB9tnSCfy1UpjrQJ9bzXL0=; b=e7l5I2B+5e4DDkBKfCPmVEzzvxt0ohYg6jWqGmCbwfA87zBOzUt42v2zMfwJhDdyGW dn49uLGOMscVNoXvoAeYnzTOepthMkC6x8KLqy7SMm9NQyonjWlJAhcmGMfx0OzvuLh7 3d9IU0OYlDFAyfCqGVExFB9OE+8paAUhPgkbT1YnRCb15Q9sR2XncKtgszidBlcu8vfF U2YdIZIcH43xbdQAgokqj2jIzRV5hkwe0ceqWGunPTBaJBywmkTM6g/i2VP0801zx38e 6AxsC5qRnPfYlkoLPNOh4bKPWKsYFIaIGtUCHTkrkzNvlZQDnmLtqxXzr/l4/9hGP61D fMmQ== 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 d16si6677753ilr.157.2021.08.20.05.43.05; Fri, 20 Aug 2021 05:43:17 -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 S240394AbhHTMm1 (ORCPT + 99 others); Fri, 20 Aug 2021 08:42:27 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:17996 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233303AbhHTMm0 (ORCPT ); Fri, 20 Aug 2021 08:42:26 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Grh4S2z3PzbgCf; Fri, 20 Aug 2021 20:38:00 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 20 Aug 2021 20:41:46 +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.2176.2; Fri, 20 Aug 2021 20:41:46 +0800 From: Tong Tiangen To: Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou CC: , , "Tong Tiangen" Subject: [PATCH -next v2 1/3] riscv/vdso: Refactor asm/vdso.h Date: Fri, 20 Aug 2021 12:50:40 +0000 Message-ID: <20210820125042.1844629-2-tongtiangen@huawei.com> X-Mailer: git-send-email 2.18.0.huawei.25 In-Reply-To: <20210820125042.1844629-1-tongtiangen@huawei.com> References: <20210820125042.1844629-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 | 10 ++-------- arch/riscv/kernel/syscall_table.c | 1 - arch/riscv/kernel/vdso.c | 5 ++++- 4 files changed, 7 insertions(+), 10 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 1453a2f563bc..c1651589dd9b 100644 --- a/arch/riscv/include/asm/vdso.h +++ b/arch/riscv/include/asm/vdso.h @@ -8,13 +8,7 @@ #ifndef _ASM_RISCV_VDSO_H #define _ASM_RISCV_VDSO_H -#include - -#ifndef CONFIG_GENERIC_TIME_VSYSCALL -struct vdso_data { -}; -#endif - +#ifndef __ASSEMBLY__ /* * The VDSO symbols are mapped into Linux so we can just use regular symbol * addressing to get their offsets in userspace. The symbols are mapped at an @@ -29,6 +23,6 @@ struct vdso_data { (void __user *)((unsigned long)(base) + __vdso_##name); \ }) -asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); +#endif #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