From nobody Mon Apr 08 06:49:09 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VCfnx4CPRz5GL7h; Mon, 8 Apr 2024 06:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VCfnx2jBSz4mTF; Mon, 8 Apr 2024 06:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712558949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hE89In7MMroBDPlFaQtu4D/kxN3obakFTf7vDQdQnpI=; b=iA3nXu5ybPyp13BvGjHW3q77kfHVIWmQWpQd566exUu5GUb4IhlQf2diHPzJ/GeBZu98x3 V+1UztZyMG5xKHqvVBqHV997jT3dajoCzXYe18iKLFNX6IfBuY6Q4WGWWXG2nnmaO8ANsH bVLdjwpCONFuWk21fXA5O9Py5cCflJMVU5S2Q90nAuBNr7Py4hi8XvFfu0jabsRnzoN1zp TFkcgBviitbr3MpBU8XJ6WTb3ihLMTASpBe7XhTHyT25z5bdyNrn4yOaoBpNM4T+DurlXZ mPa/Ff2UMCvHKjjagnPFsEt0jjfc1OlhFPCSKrkhBeiTGD+UPoLF4TP+BAETFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712558949; a=rsa-sha256; cv=none; b=W7OqMuXVtbWIGRsAJ6hso8ADGH432ywAhrL4ZAPjLSHo4jafnsCfiubgg2Rr30wNNacpvf A2o77MsEdQbDdeu1w1SCMz1+0pnOywavB8JaiZ+XB9sPOYSnnR6/coPLqa7vGD6D8p9c0P 8a8/Mn755IXm/Bw/+3S4LEUaKriwLlQpQ6G5J/i++/Z6rQ8sqJjM+2nSiW+rpPEd9HxgyM tocsbryCbDV39ZistUayXtoplOBHLC1ajzmYmR5E9LUzvy1P80/0tzllCD79u1ioJFgLS5 JdWeUYBMlLYSswp+Jl1q9UDd2ehffFs1DwQAB00hEexC19O1FQqaHRxafgVFZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712558949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hE89In7MMroBDPlFaQtu4D/kxN3obakFTf7vDQdQnpI=; b=a+gNVs2IgTi3MtwuEGbr/fluJijrsKP/7SJtHtxZDM70J8xCRJeqXEvMsl7V/u/9v24WX3 gL5+vXVPsFmg+5cnDC18waKGeR5SLJHy2RV5qE3Fd6ILCEwC1Eji9gW+HtG+3Yqm7YjtSF iyA5EKrG5TS7mqmb1ImNbAbr+gZv65PM44V16Omhk0ncJA74H+JCcwfHu5fMDewiPPYRkw 4GqDiTzcU2MlCEpOGkc/YimHRQB/xPLn4b/hcaGvPdgFXmFpPGA4yty8rLzjMC3gzWS2Av fXIEaboHIVItzI3UStA4LDgpmX1+47pZ7mVWI5BWekR/cpSzgx7epbxJy8qniQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VCfnx2GbGz11Mt; Mon, 8 Apr 2024 06:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4386n95j032675; Mon, 8 Apr 2024 06:49:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4386n9s0032672; Mon, 8 Apr 2024 06:49:09 GMT (envelope-from git) Date: Mon, 8 Apr 2024 06:49:09 GMT Message-Id: <202404080649.4386n9s0032672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8cfd1dd821bd - main - LinuxKPI: Move [SU](8|16|32|64)_(MAX|MIN) defines to linux/limits.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cfd1dd821bd8102dd91971c6ac88a64e25057d1 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8cfd1dd821bd8102dd91971c6ac88a64e25057d1 commit 8cfd1dd821bd8102dd91971c6ac88a64e25057d1 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-04-08 06:47:42 +0000 LinuxKPI: Move [SU](8|16|32|64)_(MAX|MIN) defines to linux/limits.h Some source files get them from linux/limits.h directly rather than from linux/kernel.h. While here replace Linux constant values with sys/stdint.h provided ones. Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week --- sys/compat/linuxkpi/common/include/linux/kernel.h | 14 +------ sys/compat/linuxkpi/common/include/linux/limits.h | 47 +++++++++++++++++++++++ sys/compat/linuxkpi/dummy/include/linux/limits.h | 0 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 99ba19e9e25c..96259716d3a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -70,19 +71,6 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" -#define U8_MAX ((u8)~0U) -#define S8_MAX ((s8)(U8_MAX >> 1)) -#define S8_MIN ((s8)(-S8_MAX - 1)) -#define U16_MAX ((u16)~0U) -#define S16_MAX ((s16)(U16_MAX >> 1)) -#define S16_MIN ((s16)(-S16_MAX - 1)) -#define U32_MAX ((u32)~0U) -#define S32_MAX ((s32)(U32_MAX >> 1)) -#define S32_MIN ((s32)(-S32_MAX - 1)) -#define U64_MAX ((u64)~0ULL) -#define S64_MAX ((s64)(U64_MAX >> 1)) -#define S64_MIN ((s64)(-S64_MAX - 1)) - #define S8_C(x) x #define U8_C(x) x ## U #define S16_C(x) x diff --git a/sys/compat/linuxkpi/common/include/linux/limits.h b/sys/compat/linuxkpi/common/include/linux/limits.h new file mode 100644 index 000000000000..716366033bb3 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/limits.h @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Serenity Cyber Security, LLC. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _LINUXKPI_LINUX_LIMITS_H +#define _LINUXKPI_LINUX_LIMITS_H + +#include +#include + +#define U8_MAX UINT8_MAX +#define S8_MAX INT8_MAX +#define S8_MIN INT8_MIN +#define U16_MAX UINT16_MAX +#define S16_MAX INT16_MAX +#define S16_MIN INT16_MIN +#define U32_MAX UINT32_MAX +#define S32_MAX INT32_MAX +#define S32_MIN INT32_MIN +#define U64_MAX UINT64_MAX +#define S64_MAX INT64_MAX +#define S64_MIN INT64_MIN + +#endif diff --git a/sys/compat/linuxkpi/dummy/include/linux/limits.h b/sys/compat/linuxkpi/dummy/include/linux/limits.h deleted file mode 100644 index e69de29bb2d1..000000000000