Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1865784ybh; Fri, 13 Mar 2020 08:45:00 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt4Bil8LW8o8yJhY3fWqXS8Wv6LNh5Iub9aaigbpUU9AWTnNmivZjw/s3Jq+uTIhfHIuqFC X-Received: by 2002:aca:783:: with SMTP id 125mr7758686oih.20.1584114300883; Fri, 13 Mar 2020 08:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584114300; cv=none; d=google.com; s=arc-20160816; b=spcJl4jgw2Lb5TGVjUUq0J08qSmfCzOYRfTjNDgkJ1Ysn+Xb7M2qlYhVgGFBFrUlQt LN8AZUK4BlVbU/saMO/eTq5ucguhcEirhNA30tpbKjxZrQvrnyICK6ULS60t+57MChrA Bibv0pVE3E6EYBp0omW8Uay4O9JqHoGQobupCtYWf81GxHj6IMTTSofltcyCnXJKb4JU KRmBYC0qlGlPYqdgnSuN3EW6k/HbU0ejLXKidmS9ttjiegTxya25D/LVBpshb68QSxb1 aSzMM61bPZVrgiKY+q3tgk/sICLiMkN5hiQ8QoKnJseB7TEfXUPFelWi2/U7A3iFfm7g Cw5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+Lb+MpXXTqg/9LgLvaIfE5VAfTlCV5oL3TBdI/yFVxw=; b=H/8yoPw5DNz7Al+RzKE3271kLACG2ld0MYgIsjmX9r56XI4Exk5OOoy2JzXkLajA53 IfqIeqVovp6hQp2ovqyJfi8yeq6VTct7r4Dm5YeYEwSkYdCpNFEIdv1OujaB5qpLla4z l3FDz7hdX3dbTDtRFAes8kHs5AMix+rdi0NkOK/1tdDz/W1RYiWjATwHF60/fD5HIkUp Rr6jkFu+OAKrcTlbJqkFksyWGzk9P5h7Vpv7UugVhz/SEKb3te2wtTbMfMdwi5FJfX/7 6izloPJvdUPkyDvIOmGtb6RTAHTOUDNTS5VAN9Xn6YSepfaVqKv2gUeGwS0ycXO+g7jY 4TrQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si5068468otv.12.2020.03.13.08.44.48; Fri, 13 Mar 2020 08:45:00 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgCMPoT (ORCPT + 99 others); Fri, 13 Mar 2020 11:44:19 -0400 Received: from foss.arm.com ([217.140.110.172]:58318 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgCMPoP (ORCPT ); Fri, 13 Mar 2020 11:44:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 197E731B; Fri, 13 Mar 2020 08:44:15 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 245443F67D; Fri, 13 Mar 2020 08:44:12 -0700 (PDT) From: Vincenzo Frascino To: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, clang-built-linux@googlegroups.com, x86@kernel.org Cc: Vincenzo Frascino , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Paul Burton , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Stephen Boyd , Mark Salyzyn , Kees Cook , Peter Collingbourne , Dmitry Safonov <0x7f454c46@gmail.com>, Andrei Vagin , Nick Desaulniers , Marc Zyngier , Mark Rutland Subject: [PATCH v3 03/26] linux/limits.h: Extract common header for vDSO Date: Fri, 13 Mar 2020 15:43:22 +0000 Message-Id: <20200313154345.56760-4-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200313154345.56760-1-vincenzo.frascino@arm.com> References: <20200313154345.56760-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library. Split limits.h into linux and common headers to make the latter suitable for inclusion in the vDSO library. Signed-off-by: Vincenzo Frascino --- include/linux/limits.h | 13 +------------ include/vdso/limits.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 include/vdso/limits.h diff --git a/include/linux/limits.h b/include/linux/limits.h index 76afcd24ff8c..7fc497ee1393 100644 --- a/include/linux/limits.h +++ b/include/linux/limits.h @@ -4,19 +4,8 @@ #include #include +#include -#define USHRT_MAX ((unsigned short)~0U) -#define SHRT_MAX ((short)(USHRT_MAX >> 1)) -#define SHRT_MIN ((short)(-SHRT_MAX - 1)) -#define INT_MAX ((int)(~0U >> 1)) -#define INT_MIN (-INT_MAX - 1) -#define UINT_MAX (~0U) -#define LONG_MAX ((long)(~0UL >> 1)) -#define LONG_MIN (-LONG_MAX - 1) -#define ULONG_MAX (~0UL) -#define LLONG_MAX ((long long)(~0ULL >> 1)) -#define LLONG_MIN (-LLONG_MAX - 1) -#define ULLONG_MAX (~0ULL) #define SIZE_MAX (~(size_t)0) #define PHYS_ADDR_MAX (~(phys_addr_t)0) diff --git a/include/vdso/limits.h b/include/vdso/limits.h new file mode 100644 index 000000000000..7d2cd75c7ac2 --- /dev/null +++ b/include/vdso/limits.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __VDSO_LIMITS_H +#define __VDSO_LIMITS_H + +#define USHRT_MAX ((unsigned short)~0U) +#define SHRT_MAX ((short)(USHRT_MAX >> 1)) +#define SHRT_MIN ((short)(-SHRT_MAX - 1)) +#define INT_MAX ((int)(~0U >> 1)) +#define INT_MIN (-INT_MAX - 1) +#define UINT_MAX (~0U) +#define LONG_MAX ((long)(~0UL >> 1)) +#define LONG_MIN (-LONG_MAX - 1) +#define ULONG_MAX (~0UL) +#define LLONG_MAX ((long long)(~0ULL >> 1)) +#define LLONG_MIN (-LLONG_MAX - 1) +#define ULLONG_MAX (~0ULL) + +#endif /* __VDSO_LIMITS_H */ -- 2.25.1