From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09C7BC433E2 for ; Tue, 7 Jul 2020 02:15:47 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 9219F206E6 for ; Tue, 7 Jul 2020 02:15:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KMjYoZjU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9219F206E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 447C11DCC8; Tue, 7 Jul 2020 04:15:45 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 128AB1DCB9 for ; Tue, 7 Jul 2020 04:15:43 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id i4so41476340iov.11 for ; Mon, 06 Jul 2020 19:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0LP/d7qj4eiTvwSzyA0a9SxJobW71/pCSnnJy1xGzro=; b=KMjYoZjU2bP9p5AyMyVeKTmmqK2kAZI8Hn7UBx9fCoCiYG0nL//4DE2T7NC4TCuimk KNa+w4TKb9pR2DXEn1S3HkbzmWdkgL8HFnZR4tqVYL4uAsNOiGprraSp75562fukSvLK +DdhFHkwkC+rECaMFTPntxC7ydHCcnhVgs08cJAuESymlPJJVz+z5mIaYabGWCZga1mC LltIg4spWGCNEIaTGfRMBPs5uS9atlHJQUVkTKyrtZjKYcLK5c5KVDMxF1iG14xMgBNP 2Gmte5jlmDLkAHOB3bvI8+T/jXXuB3Fnvwza315F92NAmXTZfzU7/jvPVP57sbXWtnwr k72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0LP/d7qj4eiTvwSzyA0a9SxJobW71/pCSnnJy1xGzro=; b=Yzdi6mw3ZjF7FAYQumbnzKt8JJ7i2WqXETvYbrILxOndBs4WLwXGM2ndFrEhFNyb42 I0z62RUGpVOUFAwOR/pgXk1X9TqXzrJIV7gnuN0NQo3v37kYkwwKEW839iwHdxXxn0Qg UKmCdcyq7jOw51cCtu4br0rrwoexAVFRdaLNB8zwnqisXJt0943xe81itVHd06QpI1x0 zz4jTObU4EWjUXuBFGT5ZnCGjwIeBHjkSRvhO21BUARRerhImmhQSac+skPISwenTiHo ygS4qiKY+rjVvv/ZzdAzLYddUEDHn+B7aAsUfG1aKVyJfEX4XW+PN8r8TuQWVKstUZxJ iFFw== X-Gm-Message-State: AOAM53397s3gB6u7ZyCxBmTiIgDNbeErn7QZMA4peausWy3nHHFBbgzS 84AazfDsifkfa6XiiHtFKFoOxR+N0jIjV8NuWtA= X-Google-Smtp-Source: ABdhPJwasAN8wnvZt0iL5liIc2NLMoux550CkYwp8yw4ozhV7kkX/xfDadUhoqzrB6xnaLzjAPUBZzuWhlgShTkP0D8= X-Received: by 2002:a05:6602:2d95:: with SMTP id k21mr28849048iow.59.1594088142363; Mon, 06 Jul 2020 19:15:42 -0700 (PDT) MIME-Version: 1.0 References: <20200611033248.39049-1-joyce.kong@arm.com> <20200706074930.54299-1-joyce.kong@arm.com> <20200706074930.54299-2-joyce.kong@arm.com> In-Reply-To: <20200706074930.54299-2-joyce.kong@arm.com> From: Jerin Jacob Date: Tue, 7 Jul 2020 07:45:26 +0530 Message-ID: To: Joyce Kong Cc: Maxime Coquelin , Jerin Jacob , Zhihong Wang , "Ye, Xiaolong" , Beilei Xing , jia.guo@intel.com, John McNamara , Matan Azrad , Shahaf Shuler , Slava Ovsiienko , Honnappa Nagarahalli , Phil Yang , "Ruifeng Wang (Arm Technology China)" , dpdk-dev , nd Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 1/6] lib/eal: add a common wrapper for restricted pointers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jul 6, 2020 at 1:19 PM Joyce Kong wrote: > > The 'restrict' keyword is recognized in C99, while type qulifier > '__restrict' compiles ok in C with all language levels. This patch > is to add a wrapper defining '__rte_restrict' with 'restrict' and > '__restrict' to be supported by all compilers. > > Signed-off-by: Joyce Kong Acked-by: Jerin Jacob > --- > lib/librte_eal/include/rte_common.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > index 0843ce69e..cda32c056 100644 > --- a/lib/librte_eal/include/rte_common.h > +++ b/lib/librte_eal/include/rte_common.h > @@ -103,6 +103,16 @@ typedef uint16_t unaligned_uint16_t; > */ > #define __rte_unused __attribute__((__unused__)) > > +/** > + * Define a wrapper for restricted pointers which can be supported > + * by all compilers. > + */ > +#if __STDC_VERSION__ >= 199901 > +#define __rte_restrict restrict > +#else > +#define __rte_restrict __restrict > +#endif > + > /** > * definition to mark a variable or function parameter as used so > * as to avoid a compiler warning > -- > 2.27.0 >