From patchwork Mon Feb 23 18:35:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 44911 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E00FA21570 for ; Mon, 23 Feb 2015 18:35:49 +0000 (UTC) Received: by eekd17 with SMTP id d17sf12452620eek.2 for ; Mon, 23 Feb 2015 10:35:49 -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=+0FtPrYSCmzpoxkHFXjSWfcJdv9+icGsFsFKj9Kd1r4=; b=Ex7pnB7G0hXxg62bUgj0FqcgabMhfN0ijyYMiyeQ6UeYBRWWOIC7vmoq5l1mCF9EdL xsNqqWoB0hu3rtveQ7A+h1SCK15GyUd5rgmwpjLhRaO7ih3PzNHuqaCOKsDsV+fWLPAr vJCxh3x4ZMrUQ7IjT4uRr1cG0rDjYQ9dmEtdoV9w3JVQpBWs+jNr2pI5BioYBU/1AbbB vfsVi33VvHnWfQLpNjRxHQRr3gu78cu6J686tUgHCPAtqhf86x8eXw+3Cs0MfMlJdtLI HaGEouUHldxhDkwnaCj7OPnGyYc5etUP72g90NrL81FFk+BnCC1F+c1dHMXUh6j43l1a 1ktQ== X-Gm-Message-State: ALoCoQn4MBac9Q27WkQAJFwMbtiV2C8mUJuPk6wcIxrFLr5Zp5kqXwMeAGQ5EsfF/WGhhGNkmX5q X-Received: by 10.112.159.227 with SMTP id xf3mr1568404lbb.11.1424716549095; Mon, 23 Feb 2015 10:35:49 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.33 with SMTP id cj1ls632161lad.53.gmail; Mon, 23 Feb 2015 10:35:48 -0800 (PST) X-Received: by 10.112.126.130 with SMTP id my2mr11220752lbb.55.1424716548821; Mon, 23 Feb 2015 10:35:48 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id mt5si26638357lbb.59.2015.02.23.10.35.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Feb 2015 10:35:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbjb6 with SMTP id b6so20426879lbj.2 for ; Mon, 23 Feb 2015 10:35:48 -0800 (PST) X-Received: by 10.112.118.211 with SMTP id ko19mr11137638lbb.19.1424716548664; Mon, 23 Feb 2015 10:35:48 -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 h5csp1441257lbj; Mon, 23 Feb 2015 10:35:47 -0800 (PST) X-Received: by 10.140.150.21 with SMTP id 21mr711248qhw.69.1424716546958; Mon, 23 Feb 2015 10:35:46 -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 ie5si4168205qcb.18.2015.02.23.10.35.45 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 23 Feb 2015 10:35:46 -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 1YPxr5-0001yj-36; Mon, 23 Feb 2015 18:35:43 +0000 Received: from mail-qg0-f43.google.com ([209.85.192.43]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YPxqt-0001xH-5o for lng-odp@lists.linaro.org; Mon, 23 Feb 2015 18:35:31 +0000 Received: by mail-qg0-f43.google.com with SMTP id i50so25917150qgf.2 for ; Mon, 23 Feb 2015 10:35:26 -0800 (PST) X-Received: by 10.140.145.13 with SMTP id 13mr27213178qhr.104.1424716526010; Mon, 23 Feb 2015 10:35:26 -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 o5sm28093898qat.4.2015.02.23.10.35.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Feb 2015 10:35:25 -0800 (PST) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Mon, 23 Feb 2015 13:35:17 -0500 Message-Id: <1424716517-17175-3-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424716517-17175-1-git-send-email-mike.holmes@linaro.org> References: <1424716517-17175-1-git-send-email-mike.holmes@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 3/3] api: config: rename ODP_SHM_NUM_BLOCKS to ODP_CONFIG_SHM_NUM_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.179 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 965f6f0..1cc07a3 100644 --- a/include/odp/api/config.h +++ b/include/odp/api/config.h @@ -125,7 +125,7 @@ extern "C" { * * Limits how many blocks are available for calls to odp_shm_reserve() */ -#define ODP_SHM_NUM_BLOCKS 64 +#define ODP_CONFIG_SHM_NUM_BLOCKS 64 /** * @} diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index 9b6e92b..d37567f 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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_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_NUM_BLOCKS; i++) { odp_shm_block_t *block; block = &odp_shm_tbl->block[i];