From patchwork Thu Jul 9 13:46:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 50961 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 398E5228E5 for ; Thu, 9 Jul 2015 13:49:29 +0000 (UTC) Received: by lbko2 with SMTP id o2sf10333913lbk.0 for ; Thu, 09 Jul 2015 06:49:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc: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=4Ugtc3Ews8boJ/XcbhxXJO6Ukdnqgy0ni+8QTyqsoPE=; b=RPDdvI6FNLDjAVEh5JQo9r95Kdk6MzkYpo9cRufY1FQBSgauraL7A5IBgeOAdi8rQ5 ImQmfKIfEzupRf7vb7lQi7458v+x/rZOLwATK2qCjXHgOkerlsr7pB4cpZ3VETU0SYCD HJrbF9xIyKPy6wVUaRHjQF2wU1SJCVXUPERA35kYNoPeIObm9ec7y5zGHoIA0MZI+NQe kCoKZX0cHvapH1n197ns7d3BB5CxvwTvzJP9zYzWsGNHjW2qqWUqV5QMQrF0U2Sl1THE btXh6MndQjBav2otYgUSJy0tEbBB0WoMJ1VEMv51aHiVmqFCCIVecYRNm+jKGmABGlwa J7dw== X-Gm-Message-State: ALoCoQkNZGtNNTgeioHlTXVl1o16IaVvKWWHtWB3sZesIxx3Exlv6u2vRXu8jn1THtTSMiQpUgfE X-Received: by 10.152.22.163 with SMTP id e3mr7995798laf.6.1436449768276; Thu, 09 Jul 2015 06:49:28 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.231 with SMTP id e7ls559891laa.34.gmail; Thu, 09 Jul 2015 06:49:28 -0700 (PDT) X-Received: by 10.152.37.102 with SMTP id x6mr14894785laj.69.1436449768124; Thu, 09 Jul 2015 06:49:28 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id pz9si4861983lbb.92.2015.07.09.06.49.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 06:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbnk3 with SMTP id k3so75474017lbn.1 for ; Thu, 09 Jul 2015 06:49:28 -0700 (PDT) X-Received: by 10.152.36.161 with SMTP id r1mr14929236laj.88.1436449767954; Thu, 09 Jul 2015 06:49:27 -0700 (PDT) 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.108.230 with SMTP id hn6csp681731lbb; Thu, 9 Jul 2015 06:49:26 -0700 (PDT) X-Received: by 10.140.88.5 with SMTP id s5mr24329431qgd.59.1436449764921; Thu, 09 Jul 2015 06:49:24 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id w10si6099247qkw.84.2015.07.09.06.49.24; Thu, 09 Jul 2015 06:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id E8A1361FF6; Thu, 9 Jul 2015 13:49:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1876B61FC3; Thu, 9 Jul 2015 13:47:18 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 673D361FD3; Thu, 9 Jul 2015 13:47:13 +0000 (UTC) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by lists.linaro.org (Postfix) with ESMTPS id 3D97B61FC0 for ; Thu, 9 Jul 2015 13:46:38 +0000 (UTC) Received: by wicmv11 with SMTP id mv11so1734801wic.1 for ; Thu, 09 Jul 2015 06:46:37 -0700 (PDT) X-Received: by 10.180.149.146 with SMTP id ua18mr86508686wib.29.1436449597483; Thu, 09 Jul 2015 06:46:37 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id df1sm8414627wib.12.2015.07.09.06.46.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 06:46:36 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Thu, 9 Jul 2015 16:46:17 +0300 Message-Id: <1436449585-23252-4-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> References: <1436449585-23252-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Cc: Petri Savolainen Subject: [lng-odp] [PATCH 03/11] api: cpumask: added cpumask_setall X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@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.217.182 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 From: Petri Savolainen The call sets all possible CPUs in the mask. It's system specific which CPUs are actually available to the application. Signed-off-by: Petri Savolainen Reviewed-by: Christophe Milard Signed-off-by: Maxim Uvarov --- include/odp/api/cpumask.h | 15 +++++++++++++-- platform/linux-generic/odp_cpumask.c | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h index dbac7b9..1fdbfb4 100644 --- a/include/odp/api/cpumask.h +++ b/include/odp/api/cpumask.h @@ -65,6 +65,17 @@ void odp_cpumask_zero(odp_cpumask_t *mask); void odp_cpumask_set(odp_cpumask_t *mask, int cpu); /** + * Set all CPUs in mask + * + * Set all possible CPUs in the mask. All CPUs from 0 to odp_cpumask_count() + * minus one are set, regardless of which CPUs are actually available to + * the application. + * + * @param mask CPU mask to set + */ +void odp_cpumask_setall(odp_cpumask_t *mask); + +/** * Remove CPU from mask * @param mask CPU mask to update * @param cpu CPU number @@ -82,7 +93,7 @@ void odp_cpumask_clr(odp_cpumask_t *mask, int cpu); int odp_cpumask_isset(const odp_cpumask_t *mask, int cpu); /** - * Count number of CPU's in mask + * Count number of CPUs set in mask * * @param mask CPU mask * @return population count @@ -120,7 +131,7 @@ void odp_cpumask_xor(odp_cpumask_t *dest, const odp_cpumask_t *src1, const odp_cpumask_t *src2); /** - * Test if two CPU masks contain the same CPU's + * Test if two CPU masks contain the same CPUs * * @param mask1 CPU mask 1 * @param mask2 CPU mask 2 diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c index 0ca1071..a89c3b6 100644 --- a/platform/linux-generic/odp_cpumask.c +++ b/platform/linux-generic/odp_cpumask.c @@ -125,6 +125,14 @@ void odp_cpumask_set(odp_cpumask_t *mask, int cpu) CPU_SET(cpu, &mask->set); } +void odp_cpumask_setall(odp_cpumask_t *mask) +{ + int cpu; + + for (cpu = 0; cpu < CPU_SETSIZE; cpu++) + CPU_SET(cpu, &mask->set); +} + void odp_cpumask_clr(odp_cpumask_t *mask, int cpu) { CPU_CLR(cpu, &mask->set);