From patchwork Thu Feb 26 18:56:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 45199 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B163620674 for ; Thu, 26 Feb 2015 18:57:26 +0000 (UTC) Received: by wghb13 with SMTP id b13sf9802668wgh.2 for ; Thu, 26 Feb 2015 10:57:25 -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=fi4SnsOZ8wl31P8Ar0nlKUgln9fdiwR8WZ1dEnJy/E8=; b=UaLP+3r6rgPs5QbuoFNle3ru2sd50YwQ22hOzRufJra3x1ThE+9v9JK+iZjVE65/jV cynIOG++PZeGem2r8UxB9UVzS+SZ+QtPoOx3/zstGM+J2nZx5XgGnZQUB93/ev9H4wUi SlyQyVAOidr+ye9FxUdjfc/Vy7k+D2gtZtnkjcjkJ+PUkWeXH7Sx7/dDDwtIGCe1FN++ o3rUmwTj0VFcyf8lc9OQfYPRStq9BYPqf727kzD5/lVAuRNnSqjMt3zTCf69R2ftvQ1+ bcPdodfpN0mfGc3wn7PtPlYPsKx21Ww5OTw8Ko4tK1Y+Wc9YdcaL6QHEKS3Yj2pP4lA8 GwKg== X-Gm-Message-State: ALoCoQkv7AW8iEXPeqHzC+YOkHLcCfSPWr9fJk4SIaFe5w+WCiVytNNACPQCMv7K+hUV+hx/8MX1 X-Received: by 10.112.147.35 with SMTP id th3mr1304960lbb.15.1424977045854; Thu, 26 Feb 2015 10:57:25 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.99 with SMTP id lf3ls80441lac.4.gmail; Thu, 26 Feb 2015 10:57:25 -0800 (PST) X-Received: by 10.152.88.49 with SMTP id bd17mr9067497lab.43.1424977045683; Thu, 26 Feb 2015 10:57:25 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id v19si1295419laz.60.2015.02.26.10.57.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 10:57:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbiz11 with SMTP id z11so12815223lbi.5 for ; Thu, 26 Feb 2015 10:57:25 -0800 (PST) X-Received: by 10.152.22.67 with SMTP id b3mr8902306laf.117.1424977045588; Thu, 26 Feb 2015 10:57:25 -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.35.133 with SMTP id h5csp3491922lbj; Thu, 26 Feb 2015 10:57:24 -0800 (PST) X-Received: by 10.140.93.199 with SMTP id d65mr19870076qge.104.1424977044288; Thu, 26 Feb 2015 10:57:24 -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 h4si1641719qan.50.2015.02.26.10.57.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 26 Feb 2015 10:57:24 -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 1YR3cf-00087b-Jc; Thu, 26 Feb 2015 18:57:21 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YR3cT-000851-3P for lng-odp@lists.linaro.org; Thu, 26 Feb 2015 18:57:09 +0000 Received: by mail-qg0-f51.google.com with SMTP id z60so10184627qgd.10 for ; Thu, 26 Feb 2015 10:57:03 -0800 (PST) X-Received: by 10.229.207.198 with SMTP id fz6mr21492269qcb.27.1424977023841; Thu, 26 Feb 2015 10:57:03 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id q5sm1064652qat.6.2015.02.26.10.57.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Feb 2015 10:57:03 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Thu, 26 Feb 2015 13:56:55 -0500 Message-Id: <1424977016-9990-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424977016-9990-1-git-send-email-mike.holmes@linaro.org> References: <1424977016-9990-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v4 3/4] api: config: rename ODP_SHM_NUM_BLOCKS to ODP_CONFIG_SHM_BLOCKS 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: mike.holmes@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.173 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: Mike Holmes --- include/odp/api/config.h | 2 +- platform/linux-generic/odp_shared_memory.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/odp/api/config.h b/include/odp/api/config.h index 61fcffa..91ea34e 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -125,7 +125,7 @@ extern "C" { * * This the the number of separate SHM areas that can be reserved concurrently */ -#define ODP_SHM_NUM_BLOCKS (ODP_CONFIG_POOLS + 48) +#define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS + 48) /** * @} diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index de80140..d6b912d 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -44,7 +44,7 @@ typedef struct { typedef struct { - odp_shm_block_t block[ODP_SHM_NUM_BLOCKS]; + odp_shm_block_t block[ODP_CONFIG_SHM_BLOCKS]; odp_spinlock_t lock; } odp_shm_table_t; @@ -115,7 +115,7 @@ static int find_block(const char *name, uint32_t *index) { uint32_t i; - for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) { + for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) { if (strcmp(name, odp_shm_tbl->block[i].name) == 0) { /* found it */ if (index != NULL) @@ -141,7 +141,7 @@ int odp_shm_free(odp_shm_t shm) i = from_handle(shm); - if (i >= ODP_SHM_NUM_BLOCKS) { + if (i >= ODP_CONFIG_SHM_BLOCKS) { ODP_DBG("odp_shm_free: Bad handle\n"); return -1; } @@ -225,14 +225,14 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, return ODP_SHM_INVALID; } - for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) { + for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) { if (odp_shm_tbl->block[i].addr == NULL) { /* Found free block */ break; } } - if (i > ODP_SHM_NUM_BLOCKS - 1) { + if (i > ODP_CONFIG_SHM_BLOCKS - 1) { /* Table full */ odp_spinlock_unlock(&odp_shm_tbl->lock); ODP_DBG("odp_shm_reserve: no more blocks\n"); @@ -330,7 +330,7 @@ void *odp_shm_addr(odp_shm_t shm) i = from_handle(shm); - if (i > (ODP_SHM_NUM_BLOCKS - 1)) + if (i > (ODP_CONFIG_SHM_BLOCKS - 1)) return NULL; return odp_shm_tbl->block[i].addr; @@ -344,7 +344,7 @@ int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info) i = from_handle(shm); - if (i > (ODP_SHM_NUM_BLOCKS - 1)) + if (i > (ODP_CONFIG_SHM_BLOCKS - 1)) return -1; block = &odp_shm_tbl->block[i]; @@ -373,7 +373,7 @@ void odp_shm_print_all(void) ODP_PRINT(" id name kB align huge addr\n"); - for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) { + for (i = 0; i < ODP_CONFIG_SHM_BLOCKS; i++) { odp_shm_block_t *block; block = &odp_shm_tbl->block[i];