From patchwork Tue Feb 24 19:27:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44992 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E83E62029F for ; Tue, 24 Feb 2015 19:28:35 +0000 (UTC) Received: by wghb13 with SMTP id b13sf5599595wgh.2 for ; Tue, 24 Feb 2015 11:28:35 -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=GqZuPNIuLx3Ta7/XxUTW0j19ll4t0xqsBJ4EBb9YuM8=; b=B1Ev3FiAQgJ7S3qvuHNSpDQlQhyxX+cBct5YpepumaVYBDtwOL81GvTTHSItfkWX69 Delbad7S9KuWJs499iloB7ajXyyaIG5Xhed/LqJr1sPsBFEilAhRoWONksl42jB5fY1k wQcOwqY2fO7sOC6Yk6Jk/Tm52LbGx6qHbToJixDVKQeAJ0WZMZZQ1pLcASp30GAYLyee h0pk3n9JLU586a7IcvZhH9jWzi9BUNvFAnr//RJBwfmN6AHVR1+1xw0yLbiHbp9uav2K lka6d24Bxt76DlvpZ1/kcJawGh+sHLE4VsDWwda3AHXiw+L1RQDS4vbLZSrHIi874tBK fYTg== X-Gm-Message-State: ALoCoQldY4/7BlbZ6bkxRpnXUWB184GZohgFNn1blIlzVWixHQAzVh/KlII/LjmyvVj1Q67tMFDR X-Received: by 10.180.182.44 with SMTP id eb12mr2350149wic.4.1424806115266; Tue, 24 Feb 2015 11:28:35 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.131 with SMTP id am3ls649557lac.35.gmail; Tue, 24 Feb 2015 11:28:35 -0800 (PST) X-Received: by 10.112.62.135 with SMTP id y7mr15624992lbr.50.1424806115103; Tue, 24 Feb 2015 11:28:35 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id ok9si1617909lbb.18.2015.02.24.11.28.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 11:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lams18 with SMTP id s18so28052251lam.11 for ; Tue, 24 Feb 2015 11:28:35 -0800 (PST) X-Received: by 10.152.21.201 with SMTP id x9mr4963142lae.72.1424806115011; Tue, 24 Feb 2015 11:28:35 -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 h5csp2126547lbj; Tue, 24 Feb 2015 11:28:34 -0800 (PST) X-Received: by 10.140.94.87 with SMTP id f81mr37745747qge.38.1424806113201; Tue, 24 Feb 2015 11:28:33 -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 n62si22040591qha.23.2015.02.24.11.28.31 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 11:28:33 -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 1YQL9i-0003CR-8U; Tue, 24 Feb 2015 19:28:30 +0000 Received: from mail-qc0-f178.google.com ([209.85.216.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YQL9M-00036t-Tf for lng-odp@lists.linaro.org; Tue, 24 Feb 2015 19:28:08 +0000 Received: by qcvx3 with SMTP id x3so5756787qcv.5 for ; Tue, 24 Feb 2015 11:28:03 -0800 (PST) X-Received: by 10.140.38.102 with SMTP id s93mr19214066qgs.106.1424806083760; Tue, 24 Feb 2015 11:28: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 68sm30076533qgz.8.2015.02.24.11.28.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Feb 2015 11:28:03 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Tue, 24 Feb 2015 14:27:53 -0500 Message-Id: <1424806074-26864-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424806074-26864-1-git-send-email-mike.holmes@linaro.org> References: <1424806074-26864-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 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.215.43 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 b3e8438..b6a8d7c 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 * 4) +#define ODP_CONFIG_SHM_BLOCKS (ODP_CONFIG_POOLS * 4) /** * @} diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 9b6e92b..1eb288e 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; @@ -104,7 +104,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) @@ -130,7 +130,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; } @@ -214,14 +214,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"); @@ -319,7 +319,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; @@ -333,7 +333,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]; @@ -362,7 +362,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];