From patchwork Mon Apr 28 11:41:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 29221 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACABA20553 for ; Mon, 28 Apr 2014 11:42:52 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf24402021qcy.3 for ; Mon, 28 Apr 2014 04:42:52 -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:in-reply-to :references:cc: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=VW7Cbxw5wxEl5M63S7RzfKsCpS77TxJTwxCaJNyPvNY=; b=AaAH4fQlX1fmks5wExaTeT1HpmSyhfpGQnqlzw1SeEFUx1ZU1/b5k1WCi4IORDsGpE P1O3YhDKSEoTgCTmmEpTuqaA2SRtyhyDqfhJlfNrYcVHUakO5bdKBjSIaFumad6AJlIb T4MLXfVFITfi2bWAyYZEZL0mCD71r1TxRRJqo9paI/V6EtcZq6mZIqiRV9EU3MfquKXJ JGlR9ixskBNhOprj9ibnpS4de3MBEqUQR6WZ57nc066pVypJhk6aEUlbc/t5AXdckYOk H3W88T4Pc/+zIn4ZKHcrRPcPIEPHMeRxn+/FWY7gFrK+wBOOtRZMJ0aIJ+9w+Eibg+Ii qclA== X-Gm-Message-State: ALoCoQmPQ0OQDq6l1+Cu/HWZ+wHqqaoN0e7idDKWkPEKDLjWhtvySPRwVzj7nVAbOJX78Gg0pyqK X-Received: by 10.224.147.72 with SMTP id k8mr12111048qav.5.1398685372494; Mon, 28 Apr 2014 04:42:52 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.112 with SMTP id n103ls2569916qga.86.gmail; Mon, 28 Apr 2014 04:42:52 -0700 (PDT) X-Received: by 10.52.53.101 with SMTP id a5mr20268213vdp.14.1398685372303; Mon, 28 Apr 2014 04:42:52 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id v8si3557353vcs.68.2014.04.28.04.42.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:42:52 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id hq16so5336340vcb.39 for ; Mon, 28 Apr 2014 04:42:52 -0700 (PDT) X-Received: by 10.58.55.170 with SMTP id t10mr1241700vep.29.1398685372208; Mon, 28 Apr 2014 04:42:52 -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.220.221.72 with SMTP id ib8csp110843vcb; Mon, 28 Apr 2014 04:42:51 -0700 (PDT) X-Received: by 10.140.19.133 with SMTP id 5mr30538729qgh.46.1398685371808; Mon, 28 Apr 2014 04:42:51 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id x7si7609131qaj.48.2014.04.28.04.42.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:42:51 -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-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wejx1-0002rT-1x; Mon, 28 Apr 2014 11:42:23 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Wejw3-0002mO-KM for lng-odp@lists.linaro.org; Mon, 28 Apr 2014 11:41:23 +0000 Received: by mail-la0-f50.google.com with SMTP id gl10so1340708lab.23 for ; Mon, 28 Apr 2014 04:41:45 -0700 (PDT) X-Received: by 10.152.1.8 with SMTP id 8mr18808442lai.1.1398685305752; Mon, 28 Apr 2014 04:41:45 -0700 (PDT) Received: from uglx0153363.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id x10sm9873857lad.1.2014.04.28.04.41.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Apr 2014 04:41:44 -0700 (PDT) From: Taras Kondratiuk To: lng-odp@lists.linaro.org Date: Mon, 28 Apr 2014 14:41:11 +0300 Message-Id: <1398685276-4610-13-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> References: <1398685276-4610-1-git-send-email-taras.kondratiuk@linaro.org> X-Topics: patch Cc: linaro-networking@linaro.org Subject: [lng-odp] [RFC PATCH 12/17] Split out platform-specific part of odp_queue.h 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: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 --- include/odp_queue.h | 45 +++++++++----------- platform/linux-generic/include/plat/odp_queue.h | 50 +++++++++++++++++++++++ 2 files changed, 70 insertions(+), 25 deletions(-) create mode 100644 platform/linux-generic/include/plat/odp_queue.h diff --git a/include/odp_queue.h b/include/odp_queue.h index 6401aea..695513f 100644 --- a/include/odp_queue.h +++ b/include/odp_queue.h @@ -24,18 +24,6 @@ extern "C" { /** - * ODP queue - */ -typedef uint32_t odp_queue_t; - -/** Invalid queue */ -#define ODP_QUEUE_INVALID 0 - -/** Maximum queue name lenght in chars */ -#define ODP_QUEUE_NAME_LEN 32 - - -/** * ODP queue type */ typedef int odp_queue_type_t; @@ -51,20 +39,21 @@ typedef int odp_queue_type_t; typedef int odp_schedule_prio_t; /** Highest scheduling priority */ -#define ODP_SCHED_PRIO_HIGHEST 0 +#define ODP_SCHED_PRIO_HIGHEST PLAT_ODP_SCHED_PRIO_HIGHEST /** Normal scheduling priority */ -#define ODP_SCHED_PRIO_NORMAL (ODP_CONFIG_SCHED_PRIOS / 2) +#define ODP_SCHED_PRIO_NORMAL PLAT_ODP_SCHED_PRIO_NORMAL /** Lowest scheduling priority */ -#define ODP_SCHED_PRIO_LOWEST (ODP_CONFIG_SCHED_PRIOS - 1) +#define ODP_SCHED_PRIO_LOWEST PLAT_ODP_SCHED_PRIO_LOWEST /** Default scheduling priority */ -#define ODP_SCHED_PRIO_DEFAULT ODP_SCHED_PRIO_NORMAL +#define ODP_SCHED_PRIO_DEFAULT PLAT_ODP_SCHED_PRIO_NORMAL /** * ODP schedule synchronisation + * TODO: Can sync type values be platform specific? */ typedef int odp_schedule_sync_t; @@ -73,7 +62,7 @@ typedef int odp_schedule_sync_t; #define ODP_SCHED_SYNC_ORDERED 2 /**< Ordered queue */ /** Default queue synchronisation */ -#define ODP_SCHED_SYNC_DEFAULT ODP_SCHED_SYNC_ATOMIC +#define ODP_SCHED_SYNC_DEFAULT PLAT_ODP_SCHED_SYNC_DEFAULT /** * ODP schedule core group @@ -84,7 +73,7 @@ typedef int odp_schedule_group_t; #define ODP_SCHED_GROUP_ALL 0 /** Default core group */ -#define ODP_SCHED_GROUP_DEFAULT ODP_SCHED_GROUP_ALL +#define ODP_SCHED_GROUP_DEFAULT PLAT_ODP_SCHED_GROUP_DEFAULT /** @@ -100,6 +89,19 @@ typedef union odp_queue_param_t { } odp_queue_param_t; +#include + +/** + * ODP queue + */ +typedef plat_odp_queue_t odp_queue_t; + +/** Invalid queue */ +#define ODP_QUEUE_INVALID PLAT_ODP_QUEUE_INVALID + +/** Maximum queue name lenght in chars */ +#define ODP_QUEUE_NAME_LEN PLAT_ODP_QUEUE_NAME_LEN + /** * Queue create @@ -193,10 +195,3 @@ odp_schedule_sync_t odp_queue_sched_type(odp_queue_t queue); #endif #endif - - - - - - - diff --git a/platform/linux-generic/include/plat/odp_queue.h b/platform/linux-generic/include/plat/odp_queue.h new file mode 100644 index 0000000..ff174b4 --- /dev/null +++ b/platform/linux-generic/include/plat/odp_queue.h @@ -0,0 +1,50 @@ +/* Copyright (c) 2013, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + + +/** + * @file + * + * ODP queue + */ + +#ifndef ODP_QUEUE_H_ +#error This file should be included only into corresponding top level header +#else + +#include + +/** + * ODP queue + */ +typedef uint32_t plat_odp_queue_t; + +/** Invalid queue */ +#define PLAT_ODP_QUEUE_INVALID 0 + +/** Maximum queue name lenght in chars */ +#define PLAT_ODP_QUEUE_NAME_LEN 32 + + +/** Highest scheduling priority */ +#define PLAT_ODP_SCHED_PRIO_HIGHEST 0 + +/** Normal scheduling priority */ +#define PLAT_ODP_SCHED_PRIO_NORMAL (ODP_CONFIG_SCHED_PRIOS / 2) + +/** Lowest scheduling priority */ +#define PLAT_ODP_SCHED_PRIO_LOWEST (ODP_CONFIG_SCHED_PRIOS - 1) + +/** Default scheduling priority */ +#define PLAT_ODP_SCHED_PRIO_DEFAULT PLAT_ODP_SCHED_PRIO_NORMAL + +/** Default queue synchronisation */ +#define PLAT_ODP_SCHED_SYNC_DEFAULT ODP_SCHED_SYNC_ATOMIC + +/** Default core group */ +#define PLAT_ODP_SCHED_GROUP_DEFAULT ODP_SCHED_GROUP_ALL + +#endif