From patchwork Wed Oct 1 16:55:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38251 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17AD220549 for ; Wed, 1 Oct 2014 16:55:32 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf105239wib.1 for ; Wed, 01 Oct 2014 09:55:32 -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:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=gRukxuvW2gDvJzNn+NTVCgNrjNq6i4P7CoIm8VwizrU=; b=XqubKk4Vk6nF8Je0x/LUuwv6wWUZJrPVpFEvdF1o4o9vAJiuUDBvH2sMZyv5pGCpcw 2PUeB12mwNSTyoWoXxJ0YEpPhs6YxSjjilSZURuAA2kKoPFLIOAP7krMJrWDe2wqOKKy 7EgmnI1vVK1kOcEQK3lWkS7kR66hMvlbv8yAYp9PgCl2ywWVeKhZR7ovVQffPQX5LUnW m48NUPu2HD6G95FbGgdcngVa4h2ZACAi9wDg9p3B9eyhcP+JMSd9ydocXgMDvgF0Zixp gOPD+wc2Wh9VMViROM2iGLcDp8D4aitYldCR+QTp6sP3dSZNIQUVejFcztNNC3FSZ7hk mT5w== X-Gm-Message-State: ALoCoQkjH9325NAMIIcMaZbZNqlI3IHPXHY+/+hhTW3bSlWypIg0AsVjwlPCyceQo22oxgL61Ma3 X-Received: by 10.112.168.225 with SMTP id zz1mr1885088lbb.8.1412182532181; Wed, 01 Oct 2014 09:55:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.135 with SMTP id k7ls171003lah.78.gmail; Wed, 01 Oct 2014 09:55:31 -0700 (PDT) X-Received: by 10.152.43.18 with SMTP id s18mr55394734lal.68.1412182531929; Wed, 01 Oct 2014 09:55:31 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id j2si2617723lbv.86.2014.10.01.09.55.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 09:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id gi9so788867lab.5 for ; Wed, 01 Oct 2014 09:55:31 -0700 (PDT) X-Received: by 10.112.75.233 with SMTP id f9mr19247796lbw.102.1412182531667; Wed, 01 Oct 2014 09:55:31 -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.130.169 with SMTP id of9csp571786lbb; Wed, 1 Oct 2014 09:55:31 -0700 (PDT) X-Received: by 10.229.236.8 with SMTP id ki8mr72550693qcb.12.1412182530582; Wed, 01 Oct 2014 09:55:30 -0700 (PDT) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id x5si2663326qax.64.2014.10.01.09.55.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 09:55:30 -0700 (PDT) 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 1XZNBY-0001Mt-UZ; Wed, 01 Oct 2014 16:55:28 +0000 Received: from mail-qc0-f169.google.com ([209.85.216.169]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XZNBT-0001MI-Gs for lng-odp@lists.linaro.org; Wed, 01 Oct 2014 16:55:23 +0000 Received: by mail-qc0-f169.google.com with SMTP id i8so675725qcq.14 for ; Wed, 01 Oct 2014 09:55:18 -0700 (PDT) X-Received: by 10.229.71.73 with SMTP id g9mr72008729qcj.19.1412182518068; Wed, 01 Oct 2014 09:55:18 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id n88sm1066923qge.12.2014.10.01.09.55.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Oct 2014 09:55:17 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Wed, 1 Oct 2014 12:55:04 -0400 Message-Id: <1412182504-17011-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v8] Add global_init params 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.46 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 --- example/generator/odp_generator.c | 2 +- example/ipsec/odp_ipsec.c | 2 +- example/l2fwd/odp_l2fwd.c | 2 +- example/odp_example/odp_example.c | 2 +- example/packet/odp_pktio.c | 2 +- example/timer/odp_timer_test.c | 2 +- platform/linux-generic/include/api/odp_init.h | 31 ++++++++++++++++++++++----- platform/linux-generic/odp_init.c | 3 ++- test/api_test/odp_common.c | 2 +- 9 files changed, 35 insertions(+), 13 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 27fc868..b2b886f 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -526,7 +526,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index a9bba24..2339d34 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1184,7 +1184,7 @@ main(int argc, char *argv[]) odp_shm_t shm; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index 6c1d64a..d1df1d0 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -324,7 +324,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c index c80dbbc..ebca4b2 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -952,7 +952,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { printf("ODP global init failed.\n"); return -1; } diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 41315f7..fc4710c 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) odp_shm_t shm; /* Init ODP before calling anything else */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 6e1715d..9b87921 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -257,7 +257,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { printf("ODP global init failed.\n"); return -1; } diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 490324a..6ae74c9 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -24,17 +24,38 @@ extern "C" { +/** ODP initialisation data. + * Data that is required to initialize the ODP API with the + * implimnetation that is required to initialize the ODP API with the + * application specific data such as specifying a logging callback, the log + * level etc. +*/ +typedef struct odp_init_t { +} odp_init_t; + +/** ODP platform initialization data. + * @note ODP API does nothing with this data. It is the underlying + * implementation that requires it and any data passed here is not portable. + * It is required that the application takes care of identifying and + * passing any required platform specific data. + */ + +typedef struct odp_platform_init_t { +} odp_platform_init_t; + /** * Perform global ODP initalisation. * - * This function must be called once before calling - * any other ODP API functions. - * + * This function must be called once before calling any other ODP API + * functions. + * @param[in] params Those parameters that are interpreted by the ODP API + * @param[in] platform_params Those parameters that are passed without + * interpretation by the ODP API to the implementation. * @return 0 if successful */ -int odp_init_global(void); - +int odp_init_global(odp_init_t *params, + odp_platform_init_t *platform_params); /** * Perform thread local ODP initalisation. diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 5b7e192..ace55cc 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -9,7 +9,8 @@ #include -int odp_init_global(void) +int odp_init_global(odp_init_t *params ODP_UNUSED, + odp_platform_init_t *platform_params ODP_UNUSED) { odp_thread_init_global(); diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c index b0a6fbc..ed1fc97 100644 --- a/test/api_test/odp_common.c +++ b/test/api_test/odp_common.c @@ -56,7 +56,7 @@ int odp_test_global_init(void) { memset(thread_tbl, 0, sizeof(thread_tbl)); - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("ODP global init failed.\n"); return -1; }