From patchwork Fri Oct 3 15:16:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 38333 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E2B482057C for ; Fri, 3 Oct 2014 15:16:26 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf821503wgh.4 for ; Fri, 03 Oct 2014 08:16:26 -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=nPvpWob+MS433y+TN5reQKfpaFT0DVC/UF0JSnSNXk8=; b=AE1+6uML9TpNam9Une1tlaqP8GsZa5D3HSvd1PGq6uztR9vfzPxjTimp3BESCU3uS3 TtxaJ2xhO3QaBxtg0+7cb6+BFxCLq7aNNNcXA6x/Fy7Dxi5WWnqsrjrtqY7InhcaYiyp 64nhjZsuhVitUWIPDkmAKP26S0YRbzbFDADfshL7rHyvZSYL5k2yz3fes8pucpVRyP6L eV07dkrrsEZVuv9eZG42LEW3/lIpsSTYxLpgPxGZrKALXyaPBQCu26LJmxuYJ21j1jeZ TF0u2nUBFqKlRR1frhBXcfNpT3dUjGztemDkYw8PhbfH3dSKpv1X9RyE0ZUoDP4jQUxB G5ZA== X-Gm-Message-State: ALoCoQkf0O7qa6ZqxQ1Bha7JXspieKbMMElEDHzBVZ4RRIQ/qKq8Y2gppu6ES9SnZ4BVBSzBFeZI X-Received: by 10.180.101.194 with SMTP id fi2mr1936264wib.2.1412349385850; Fri, 03 Oct 2014 08:16:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.133 with SMTP id am5ls29403lac.54.gmail; Fri, 03 Oct 2014 08:16:25 -0700 (PDT) X-Received: by 10.152.27.66 with SMTP id r2mr6644378lag.84.1412349385532; Fri, 03 Oct 2014 08:16:25 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by mx.google.com with ESMTPS id qy3si11780411lbb.3.2014.10.03.08.16.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 08:16:25 -0700 (PDT) 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 mail-lb0-f173.google.com with SMTP id 10so1185330lbg.32 for ; Fri, 03 Oct 2014 08:16:25 -0700 (PDT) X-Received: by 10.112.163.103 with SMTP id yh7mr6227864lbb.73.1412349385420; Fri, 03 Oct 2014 08:16:25 -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 of9csp246762lbb; Fri, 3 Oct 2014 08:16:23 -0700 (PDT) X-Received: by 10.224.23.131 with SMTP id r3mr8223941qab.90.1412349383203; Fri, 03 Oct 2014 08:16:23 -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 53si12771224qgi.52.2014.10.03.08.16.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 03 Oct 2014 08:16:23 -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 1Xa4aj-0001AY-AP; Fri, 03 Oct 2014 15:16: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 1Xa4ad-00019l-Qd for lng-odp@lists.linaro.org; Fri, 03 Oct 2014 15:16:15 +0000 Received: by mail-qg0-f51.google.com with SMTP id z107so1038057qgd.38 for ; Fri, 03 Oct 2014 08:16:10 -0700 (PDT) X-Received: by 10.140.49.71 with SMTP id p65mr5886941qga.54.1412349370545; Fri, 03 Oct 2014 08:16:10 -0700 (PDT) Received: from fedora1.holmesfamily.ws ([98.221.136.245]) by mx.google.com with ESMTPSA id g5sm5929712qaz.39.2014.10.03.08.16.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Oct 2014 08:16:09 -0700 (PDT) From: Mike Holmes To: lng-odp@lists.linaro.org Date: Fri, 3 Oct 2014 11:16:02 -0400 Message-Id: <1412349362-60690-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v9] 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.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 --- v9: consistent spelling remove bad cut and paste in description 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 | 33 +++++++++++++++++++++------ platform/linux-generic/odp_init.c | 3 ++- test/api_test/odp_common.c | 2 +- 9 files changed, 35 insertions(+), 15 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index 6055324..eb8b340 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -519,7 +519,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 1b652cf..acaa1c2 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1176,7 +1176,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 8aa0ba0..57037cd 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -319,7 +319,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 47d764e..0e9aa3d 100644 --- a/example/odp_example/odp_example.c +++ b/example/odp_example/odp_example.c @@ -985,7 +985,7 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); /* ODP global init */ - if (odp_init_global()) { + if (odp_init_global(NULL, NULL)) { ODP_ERR("ODP global init failed.\n"); return -1; } diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 145ae47..2cf3f0d 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -299,7 +299,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 87900fc..78b2ae2 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -256,7 +256,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 13c8e44..f35ce20 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -24,20 +24,39 @@ extern "C" { +/** ODP initialisation data. + * Data that is required to initialise 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. + * Perform global ODP initialization. * + * 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. + * Perform thread local ODP initialization. * * All threads must call this function before calling * any other ODP API functions. diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index 55fa53a..c97c5aa 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_system_info_init(); 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; }