From patchwork Thu Apr 24 09:43:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 28956 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D2E05203AC for ; Thu, 24 Apr 2014 09:43:45 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id z6sf3375863yhz.4 for ; Thu, 24 Apr 2014 02:43:45 -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:message-id:date:from:user-agent :mime-version:to:references:in-reply-to:cc:subject:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=JVgPi+hXAYMeK33j3vwGTWZ0uLHndC8WFhe95vfle6E=; b=cpanbRLK48VxXrogm3oXMlcMEUwIln91H5X90BISTWb4zS1sqLebMPAemdoaMvCqKt Z+T9UtdKLjfGXEDfR6Dkq1biA2iZit762EsD4n8hiAbhTFst1+6Jc63xdr0l0xD5AAsT OE2WtOSfdT9bs7aozmPlT4CXRTe+mcy6wdR8JPmL9fjVC7U8efyfArjJ2ptglXo+W22q Y+TbEjpuPxyKPRLS1oHiEzWL1jfFV+eYUPpp3vt6VFhYog+jCWk6rpofHnKYpXvQz/ea ADRIpvtieb7apqgMqdVOl1UaiFGujDw3v7EeAdlWEnBVh4V25G6BbbAK1WRUuGi95nEZ O6PQ== X-Gm-Message-State: ALoCoQm6gE/X1HqqeENTno6nFzijSLxToIZIJSM9JVcT4PjI+RrkTjBMWiohzhH5K/BCk/dQJw1k X-Received: by 10.52.165.179 with SMTP id yz19mr528196vdb.1.1398332625598; Thu, 24 Apr 2014 02:43:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.84 with SMTP id h78ls1013068qge.54.gmail; Thu, 24 Apr 2014 02:43:45 -0700 (PDT) X-Received: by 10.52.99.168 with SMTP id er8mr461763vdb.26.1398332625495; Thu, 24 Apr 2014 02:43:45 -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 ru8si801941vcb.137.2014.04.24.02.43.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 02:43:45 -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 hq16so135897vcb.11 for ; Thu, 24 Apr 2014 02:43:45 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr563058vcx.12.1398332625424; Thu, 24 Apr 2014 02:43:45 -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 ib8csp2353vcb; Thu, 24 Apr 2014 02:43:45 -0700 (PDT) X-Received: by 10.224.2.193 with SMTP id 1mr953310qak.100.1398332624985; Thu, 24 Apr 2014 02:43:44 -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 lu1si1898335qcb.6.2014.04.24.02.43.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 24 Apr 2014 02:43:44 -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 1WdGBd-0004IV-Hl; Thu, 24 Apr 2014 09:43:21 +0000 Received: from mail-ee0-f54.google.com ([74.125.83.54]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1WdGBU-0004IQ-Pn for lng-odp@lists.linaro.org; Thu, 24 Apr 2014 09:43:12 +0000 Received: by mail-ee0-f54.google.com with SMTP id d49so1636293eek.13 for ; Thu, 24 Apr 2014 02:43:29 -0700 (PDT) X-Received: by 10.15.90.201 with SMTP id q49mr1008955eez.65.1398332609061; Thu, 24 Apr 2014 02:43:29 -0700 (PDT) Received: from [172.22.39.11] ([195.238.92.128]) by mx.google.com with ESMTPSA id 48sm14185434eei.24.2014.04.24.02.43.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 02:43:28 -0700 (PDT) Message-ID: <5358DCBE.2080904@linaro.org> Date: Thu, 24 Apr 2014 12:43:26 +0300 From: Taras Kondratiuk User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "Savolainen, Petri (NSN - FI/Espoo)" References: <1398246839-15554-1-git-send-email-taras.kondratiuk@linaro.org> <1398246839-15554-3-git-send-email-taras.kondratiuk@linaro.org>, <1398272448059.63291@caviumnetworks.com> In-Reply-To: Cc: "lng-odp@lists.linaro.org" Subject: Re: [lng-odp] [PATCH v3 2/9] Split odp_buffer.h into API and platform parts 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: , 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 On 04/24/2014 11:29 AM, Savolainen, Petri (NSN - FI/Espoo) wrote: > Hi, > > Basically all definitions (except some specific align macros I'm going to remove) in odp/include are already normative. Names of types/macros/constants and function prototypes are normative. Values are implementation specific. Implementation specific headers (xxx_internal.h) are already in linux-generic/include. > > Examples from /include: > > typedef uint32_t odp_buffer_t; > ^^^^^^^^ ^^^^^^^^^^ > specific normative > > #define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */ > ^^^^^^^^^^ ^^^^^^^^ > normative specific > > /** > * Buffer start address > * > * @param buf Buffer handle > * > * @return Buffer start address > */ > void *odp_buffer_addr(odp_buffer_t buf); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > normative > > > static inline int odp_atomic_fetch_add_int(odp_atomic_int_t *ptr, int value) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > normative > { > return __sync_fetch_and_add(ptr, value); > } > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > specific > > > We don't e.g. want to limit values implementations may use e.g. XXX_INVALID == 0 or XXX_PRIO0..7 == 0..7. Some other values may be more natural fit to the underlying HW. Application must not use values found from API, only names. Instead of removing normative part from top level headers, we can do something like this diff --git a/include/odp_buffer.h b/include/odp_buffer.h index 2d2c25a..029c7b0 100644 --- a/include/odp_buffer.h +++ b/include/odp_buffer.h @@ -21,7 +21,7 @@ extern "C" { #include - +#include @@ -29,9 +29,9 @@ extern "C" { /** * ODP buffer */ -typedef uint32_t odp_buffer_t; +typedef plat_odp_buffer_t odp_buffer_t; -#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */ +#define ODP_BUFFER_INVALID PLAT_ODP_BUFFER_INVALID /**< Invalid buffer */ /** diff --git a/platform/linux-generic/Makefile b/platform/linux-generic/Makefile index ec5d4a7..77269a4 100644 --- a/platform/linux-generic/Makefile +++ b/platform/linux-generic/Makefile @@ -137,5 +137,7 @@ headers_install: libs $(ECHO) Installing headers to $(DESTDIR)/include $(COPY) $(ODP_ROOT)/include $(DESTDIR) $(COPY) include/api/* $(DESTDIR)/include/ + $(MKDIR) $(DESTDIR)/include/plat + $(COPY) include/plat/* $(DESTDIR)/include/plat install: lib_install headers_install diff --git a/platform/linux-generic/include/plat/odp_buffer.h b/platform/linux-generic/include/plat/odp_buffer.h new file mode 100644 index 0000000..fef0321 --- /dev/null +++ b/platform/linux-generic/include/plat/odp_buffer.h @@ -0,0 +1,11 @@ +/* + * No protector. + * This file should be included only in one corresponding top level header. + */ + +/** + * ODP buffer + */ +typedef uint32_t plat_odp_buffer_t; + +#define PLAT_ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */