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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59AE3C433FE for ; Wed, 16 Mar 2022 15:41:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7BF92837C9; Wed, 16 Mar 2022 16:41:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="SLNlAC0a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECDB282065; Wed, 16 Mar 2022 16:40:58 +0100 (CET) Received: from mail-wr1-x449.google.com (mail-wr1-x449.google.com [IPv6:2a00:1450:4864:20::449]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 81F5283BAE for ; Wed, 16 Mar 2022 16:40:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3BAUyYgUKBu0eidhXVddVaT.Rdbj-QddiaXhih.STcm.ST@flex--ptosi.bounces.google.com Received: by mail-wr1-x449.google.com with SMTP id x15-20020a5d6b4f000000b001ee6c0aa287so693493wrw.9 for ; Wed, 16 Mar 2022 08:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=vqis6Ef2wTIAHYSHHS69OMFZEVpEwNRRJNVdlGF9AMI=; b=SLNlAC0aUEPAdUwcWY/dJjT0X/PcM9eGCkCCO9sAaAdxaAHBn0pbPeH5tI232xo2Tn F80o6giUWI6ly5z9BEphTskpfKU+9HdjOs/az/dTrC6hvBzG0TkAbdwwGjNT6oyFgj+E Wn87n4HqO7tnrDv9587jcZtLiic8zxKysm4caGppl8JOzOn34ZSmk7Avi/iFpH+Q/YjS 8aF02sGWZe4dxuNl1WnFXZwj5+tcWj6fLeh0j41ViA1KKFzeqyfOIo+orqH1PnhOUeg/ B8uZxrMT0kqO8QHLA6AUod0c3y503nZfZr+frkW8QMQb59MVcVJUQI0LMibrt4uzL7xF jvPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=vqis6Ef2wTIAHYSHHS69OMFZEVpEwNRRJNVdlGF9AMI=; b=IdMUWM+crkIRoB+SBM4Yg3XGaiyF0nGSqhsZTN+UrGcTK1OpAipQyULBTkarXHzAUU 911sSTvtsfBNpsejinerU7mNKt/d7rvmZx7jDaRScNUsV4D8RqZP98JHM8v09SYF29gK BbVZYqwS5sA/aIqmAIgtcwO8WDZc0giA5CwPvmMF+Ij4hzx4LMMiSKP+an20N0CyPC0Z BxjIOsRBaZbqW1n950xLVlY4IAH3Q3jiO9OXXDsIis969UGQ35Sp4kY735pgNQQDFZEP saPih2S73xfN3osyMYdgcB3wol9IZT1NSfneq0PqqcKsJBirp1U1ypLk9FZGz0tLg3wN HjQQ== X-Gm-Message-State: AOAM531vLcLY3fQEKduorh59XO2qHleJmaElZkr6OF0MINV/OY6DZPgy LyEg0oLJ9M6ZGU4wccPUTiFdAvCsw9ChAU92RT49GzB9E1SHWmC4Rs65OCWVezSGb3tMy9q7XW5 tHW05FD9unxcbPAaNPeErTk5zb0fLGFfCiPY8544coTIvY7/SlJ6rqQoi X-Google-Smtp-Source: ABdhPJydCdpZ2Cqm7nmcWHRDyEjHv4kRNq6fpSChKzZMdYYpKI0tUy/Me2Hc7iNXcaQEe907YOLH7rNc6g== X-Received: from ptosi1.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:afb]) (user=ptosi job=sendgmr) by 2002:a05:600c:2219:b0:389:bc8b:ac48 with SMTP id z25-20020a05600c221900b00389bc8bac48mr7703003wml.14.1647445252006; Wed, 16 Mar 2022 08:40:52 -0700 (PDT) Date: Wed, 16 Mar 2022 15:39:43 +0000 In-Reply-To: <20220316153948.197650-1-ptosi@google.com> Message-Id: <20220316153948.197650-4-ptosi@google.com> Mime-Version: 1.0 References: <20220316153948.197650-1-ptosi@google.com> X-Mailer: git-send-email 2.35.1.723.g4982287a31-goog Subject: [PATCH 4/9] linux/const.h: Upgrade & Merge vDSO and uAPI From: "=?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?=" To: u-boot@lists.denx.de Cc: "=?UTF-8?q?Pierre-Cl=C3=A9ment=20Tosi?=" , Simon Glass , Tom Rini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Import the header from version 5.16 of the kernel: commit df0cc57e057f18e44dac8e6c18aba47ab53202f9 Inline and . This is wrapped in "#ifndef __UBOOT__/#include/#else/{inline}" to better document the origin of the code being added to the U-Boot header (but not present in the original header) and make diff tools happier when comparing the file with its reference, which should be useful when porting future changes from the Linux header and/or if we decide to also import those included headers into the U-Boot codebase. Signed-off-by: Pierre-Cl=C3=A9ment Tosi Cc: Simon Glass Cc: Tom Rini --- include/linux/const.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/include/linux/const.h b/include/linux/const.h index 379c889232..3e3803d767 100644 --- a/include/linux/const.h +++ b/include/linux/const.h @@ -2,8 +2,13 @@ #ifndef _LINUX_CONST_H #define _LINUX_CONST_H =20 -/* const.h: Macros for dealing with constants. */ +#ifndef __UBOOT__ +#include +#else =20 +#ifndef __UBOOT__ +#include +#else /* Some constant macros are used in both assembler and * C code. Therefore we cannot annotate them always with * 'UL' and other type specifiers unilaterally. We @@ -28,7 +33,22 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) =20 +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + +#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#endif + #define UL(x) (_UL(x)) #define ULL(x) (_ULL(x)) +#endif + +/* + * This returns a constant expression while determining if an argument is + * a constant expression, most importantly without evaluating the argument= . + * Glory to Martin Uecker + */ +#define __is_constexpr(x) \ + (sizeof(int) =3D=3D sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) =20 #endif /* _LINUX_CONST_H */ --=20 2.35.1.723.g4982287a31-goog