From patchwork Sun Jan 11 17:50:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 42953 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1FE02055F for ; Sun, 11 Jan 2015 17:51:08 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id e53sf11814579eek.3 for ; Sun, 11 Jan 2015 09:51:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=pob9UHojn/nHJ0fPFPYb7cpzPSdrw8WEF3EF+UUG+C4=; b=UOkHzghjx7hqGzxNbZgr2Fd81VRmUdOYSeLSFRjgOe3ihyw1FzpDTq3qtMoo4TvboT CHk2Js8rcIP74RIK0K8tNLFbbyeGrpOj1Nk9M7KMM4weArOZdCgIGbYjpmvhdhvNEtiU yXgvW9xba2rfSakuhzi6mVhnK/7D+jbpYY7ZJxW5i5N/bhsCtXwuRwbSO7a4/EYGACJR AgnDKtvRVwa4oTNURXvBDKwgmm9Vyha/fepeabZ+Ch0wQmgpJrZNXB3pVnFr0zzZ5Cmp LKoJ38NmmzvlSJsJov8Hs0+IbPOyFsOOTcTfPY3Tl2WBNgUurpMcjOw0tRCBGHD8q7P/ E1jA== X-Gm-Message-State: ALoCoQmjv3vaEHN5zVaYdxZ50afjZ7jZH0EcrN+OAr6yalBLcsS/h8wXgAEsYHhHBo21qTsnXAC0 X-Received: by 10.152.44.225 with SMTP id h1mr3178133lam.2.1420998667645; Sun, 11 Jan 2015 09:51:07 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.232 with SMTP id h8ls629853lam.3.gmail; Sun, 11 Jan 2015 09:51:07 -0800 (PST) X-Received: by 10.152.8.82 with SMTP id p18mr32682781laa.25.1420998667426; Sun, 11 Jan 2015 09:51:07 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id an8si19143651lac.95.2015.01.11.09.51.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 11 Jan 2015 09:51:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ms9so21024151lab.10 for ; Sun, 11 Jan 2015 09:51:07 -0800 (PST) X-Received: by 10.112.41.234 with SMTP id i10mr33042103lbl.25.1420998667236; Sun, 11 Jan 2015 09:51:07 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp879556lbb; Sun, 11 Jan 2015 09:51:06 -0800 (PST) X-Received: by 10.224.30.74 with SMTP id t10mr44414504qac.8.1420998665557; Sun, 11 Jan 2015 09:51:05 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id r8si19623202qak.127.2015.01.11.09.51.04 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 11 Jan 2015 09:51:05 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YAMfG-0006ZA-QT; Sun, 11 Jan 2015 17:51:02 +0000 Received: from mail-oi0-f54.google.com ([209.85.218.54]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YAMf8-0006Ye-6X for lng-odp@lists.linaro.org; Sun, 11 Jan 2015 17:50:54 +0000 Received: by mail-oi0-f54.google.com with SMTP id u20so17821404oif.13 for ; Sun, 11 Jan 2015 09:50:49 -0800 (PST) X-Received: by 10.60.78.137 with SMTP id b9mr15254131oex.36.1420998648910; Sun, 11 Jan 2015 09:50:48 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id dd17sm7868408obb.18.2015.01.11.09.50.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Jan 2015 09:50:48 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 11 Jan 2015 11:50:36 -0600 Message-Id: <1420998638-23980-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1420998638-23980-1-git-send-email-bill.fischofer@linaro.org> References: <1420998638-23980-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 1/3] linux-generic: buffers: expand ODP_BITSIZE macro for u64 use X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Bill Fischofer --- .../linux-generic/include/odp_buffer_internal.h | 78 +++++++++++++++++----- 1 file changed, 60 insertions(+), 18 deletions(-) diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 39b0b05..b8faf63 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -29,25 +29,67 @@ extern "C" { #include #include - #define ODP_BITSIZE(x) \ - ((x) <= 2 ? 1 : \ - ((x) <= 4 ? 2 : \ - ((x) <= 8 ? 3 : \ - ((x) <= 16 ? 4 : \ - ((x) <= 32 ? 5 : \ - ((x) <= 64 ? 6 : \ - ((x) <= 128 ? 7 : \ - ((x) <= 256 ? 8 : \ - ((x) <= 512 ? 9 : \ - ((x) <= 1024 ? 10 : \ - ((x) <= 2048 ? 11 : \ - ((x) <= 4096 ? 12 : \ - ((x) <= 8196 ? 13 : \ - ((x) <= 16384 ? 14 : \ - ((x) <= 32768 ? 15 : \ - ((x) <= 65536 ? 16 : \ - (0/0))))))))))))))))) + ((x) <= (1ULL << 1) ? 1 : \ + ((x) <= (1ULL << 2) ? 2 : \ + ((x) <= (1ULL << 3) ? 3 : \ + ((x) <= (1ULL << 4) ? 4 : \ + ((x) <= (1ULL << 5) ? 5 : \ + ((x) <= (1ULL << 6) ? 6 : \ + ((x) <= (1ULL << 7) ? 7 : \ + ((x) <= (1ULL << 8) ? 8 : \ + ((x) <= (1ULL << 9) ? 9 : \ + ((x) <= (1ULL << 10) ? 10 : \ + ((x) <= (1ULL << 11) ? 11 : \ + ((x) <= (1ULL << 12) ? 12 : \ + ((x) <= (1ULL << 13) ? 13 : \ + ((x) <= (1ULL << 14) ? 14 : \ + ((x) <= (1ULL << 15) ? 15 : \ + ((x) <= (1ULL << 16) ? 16 : \ + ((x) <= (1ULL << 17) ? 17 : \ + ((x) <= (1ULL << 18) ? 18 : \ + ((x) <= (1ULL << 19) ? 19 : \ + ((x) <= (1ULL << 20) ? 20 : \ + ((x) <= (1ULL << 21) ? 21 : \ + ((x) <= (1ULL << 22) ? 22 : \ + ((x) <= (1ULL << 23) ? 23 : \ + ((x) <= (1ULL << 24) ? 24 : \ + ((x) <= (1ULL << 25) ? 25 : \ + ((x) <= (1ULL << 26) ? 26 : \ + ((x) <= (1ULL << 27) ? 27 : \ + ((x) <= (1ULL << 28) ? 28 : \ + ((x) <= (1ULL << 29) ? 29 : \ + ((x) <= (1ULL << 30) ? 30 : \ + ((x) <= (1ULL << 31) ? 31 : \ + ((x) <= (1ULL << 32) ? 32 : \ + ((x) <= (1ULL << 33) ? 33 : \ + ((x) <= (1ULL << 34) ? 34 : \ + ((x) <= (1ULL << 35) ? 35 : \ + ((x) <= (1ULL << 36) ? 36 : \ + ((x) <= (1ULL << 37) ? 37 : \ + ((x) <= (1ULL << 38) ? 38 : \ + ((x) <= (1ULL << 39) ? 39 : \ + ((x) <= (1ULL << 40) ? 40 : \ + ((x) <= (1ULL << 41) ? 41 : \ + ((x) <= (1ULL << 42) ? 42 : \ + ((x) <= (1ULL << 43) ? 43 : \ + ((x) <= (1ULL << 44) ? 44 : \ + ((x) <= (1ULL << 45) ? 45 : \ + ((x) <= (1ULL << 46) ? 46 : \ + ((x) <= (1ULL << 47) ? 47 : \ + ((x) <= (1ULL << 48) ? 48 : \ + ((x) <= (1ULL << 49) ? 49 : \ + ((x) <= (1ULL << 50) ? 50 : \ + ((x) <= (1ULL << 51) ? 51 : \ + ((x) <= (1ULL << 52) ? 52 : \ + ((x) <= (1ULL << 53) ? 53 : \ + ((x) <= (1ULL << 54) ? 54 : \ + ((x) <= (1ULL << 55) ? 55 : \ + ((x) <= (1ULL << 56) ? 56 : \ + ((x) <= (1ULL << 57) ? 57 : \ + ((x) <= (1ULL << 58) ? 58 : \ + ((x) <= (1ULL << 59) ? 59 : \ + (0/0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) _ODP_STATIC_ASSERT(ODP_CONFIG_PACKET_BUF_LEN_MIN >= 256, "ODP Segment size must be a minimum of 256 bytes");