From patchwork Sat Jul 4 23:12:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 50656 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 860A622916 for ; Sat, 4 Jul 2015 23:12:41 +0000 (UTC) Received: by laer2 with SMTP id r2sf37109604lae.3 for ; Sat, 04 Jul 2015 16:12:39 -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:delivered-to:from:to:date :message-id: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=pY6TxOw38bUcQDTygOpXa9eHt0nEf/cJFAq5oWq/KZc=; b=MC1Xe3D9I+I62DFQ0zrbfvMYs1f2B4y7WE2DVgHOhhgm4lDczgr58Tn98txZogom+2 lVfk7tzQxFjBqw4EPw5U9PQZeeq4IVR1QAyI5fSed8khbL4/wPh6u5NbLAQl+OOzv9vm eA1cnpTn/S+fa7FZ9rJUyK5ZPL4iiqMfAxINNdUQyhoOGK2ATR+iPm+FtcKimVu/PJ15 emjG5VK3QJU8lpmyW3SY/zq0fEsQKByg8Nr7+nB0DYC87OuLRtIsPVGBwO+aGnu9BS8D 5x//Zh3sp1yzo+PFp6tdtboMJYEirbQxSC/AVlFV+tFgtXdEk94Rr4qdD4hTe9+X80PZ xK/g== X-Gm-Message-State: ALoCoQlXuWmXgInbEbvu+NDxpzl4iy6ly6oTjxq/mQHMbNpXzSsBwN6OfENDRj+JjaSiyMm0Aw2K X-Received: by 10.180.9.197 with SMTP id c5mr4659015wib.0.1436051559661; Sat, 04 Jul 2015 16:12:39 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.164 with SMTP id az4ls543413lab.16.gmail; Sat, 04 Jul 2015 16:12:39 -0700 (PDT) X-Received: by 10.112.147.233 with SMTP id tn9mr41934494lbb.119.1436051559490; Sat, 04 Jul 2015 16:12:39 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id jv10si11227410lbc.13.2015.07.04.16.12.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jul 2015 16:12:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lagh6 with SMTP id h6so118228103lag.2 for ; Sat, 04 Jul 2015 16:12:38 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr42146708lbp.88.1436051558705; Sat, 04 Jul 2015 16:12:38 -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.108.230 with SMTP id hn6csp852953lbb; Sat, 4 Jul 2015 16:12:37 -0700 (PDT) X-Received: by 10.140.96.116 with SMTP id j107mr41432609qge.20.1436051556996; Sat, 04 Jul 2015 16:12:36 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c62si15646554qka.65.2015.07.04.16.12.35; Sat, 04 Jul 2015 16:12:36 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id B26A361DC5; Sat, 4 Jul 2015 23:12:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 825F261CCD; Sat, 4 Jul 2015 23:12:30 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 18AE361CCF; Sat, 4 Jul 2015 23:12:14 +0000 (UTC) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by lists.linaro.org (Postfix) with ESMTPS id 85C3F61CCC for ; Sat, 4 Jul 2015 23:12:12 +0000 (UTC) Received: by obbop1 with SMTP id op1so87129287obb.2 for ; Sat, 04 Jul 2015 16:12:12 -0700 (PDT) X-Received: by 10.60.78.197 with SMTP id d5mr19712426oex.67.1436051531944; Sat, 04 Jul 2015 16:12:11 -0700 (PDT) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id c9sm7563182oih.11.2015.07.04.16.12.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Jul 2015 16:12:11 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sat, 4 Jul 2015 18:12:01 -0500 Message-Id: <1436051526-15926-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 1/6] api: event: change to odp_event_type_t X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@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.50 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: Bill Fischofer --- include/odp/api/event.h | 23 +++++----------------- .../linux-generic/include/odp/plat/event_types.h | 13 ++++++++---- .../linux-generic/include/odp_buffer_inlines.h | 2 +- .../linux-generic/include/odp_buffer_internal.h | 2 +- platform/linux-generic/odp_event.c | 2 +- 5 files changed, 17 insertions(+), 25 deletions(-) diff --git a/include/odp/api/event.h b/include/odp/api/event.h index 63b476f..69d23b6 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.h @@ -36,23 +36,10 @@ extern "C" { */ /** - * @def ODP_EVENT_BUFFER - * Buffer event - */ - -/** - * @def ODP_EVENT_PACKET - * Packet event - */ - -/** - * @def ODP_EVENT_TIMEOUT - * Timeout event - */ - -/** - * @def ODP_EVENT_CRYPTO_COMPL - * Crypto completion event + * @typedef odp_event_type_t + * ODP event types: + * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT, + * ODP_EVENT_CRYPTO_COMPL */ /** @@ -62,7 +49,7 @@ extern "C" { * * @return Event type */ -int odp_event_type(odp_event_t event); +odp_event_type_t odp_event_type(odp_event_t event); /** * Get printable value for an odp_event_t diff --git a/platform/linux-generic/include/odp/plat/event_types.h b/platform/linux-generic/include/odp/plat/event_types.h index d91937d..06b15cd 100644 --- a/platform/linux-generic/include/odp/plat/event_types.h +++ b/platform/linux-generic/include/odp/plat/event_types.h @@ -30,10 +30,15 @@ typedef ODP_HANDLE_T(odp_event_t); #define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff) -#define ODP_EVENT_BUFFER 1 -#define ODP_EVENT_PACKET 2 -#define ODP_EVENT_TIMEOUT 3 -#define ODP_EVENT_CRYPTO_COMPL 4 +/** + * Event types + */ +typedef enum odp_event_type_t { + ODP_EVENT_BUFFER = 1, + ODP_EVENT_PACKET = 2, + ODP_EVENT_TIMEOUT = 3, + ODP_EVENT_CRYPTO_COMPL = 4, +} odp_event_type_t; /** Get printable format of odp_event_t */ static inline uint64_t odp_event_to_u64(odp_event_t hdl) diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 74af38b..18d1a2e 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -190,7 +190,7 @@ static inline void *segment_map(odp_buffer_hdr_t *buf, return (void *)seg_addr; } -static inline int _odp_buffer_event_type(odp_buffer_t buf) +static inline odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf) { return odp_buf_to_hdr(buf)->event_type; } diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index ef116c3..d9ffc06 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -117,7 +117,7 @@ typedef struct odp_buffer_hdr_t { } flags; int16_t allocator; /* allocating thread id */ int8_t type; /* buffer type */ - int8_t event_type; /* for reuse as event */ + odp_event_type_t event_type; /* for reuse as event */ uint32_t size; /* max data size */ odp_atomic_u32_t ref_count; /* reference count */ odp_pool_t pool_hdl; /* buffer pool handle */ diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index d9e86a9..f79fcc3 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -10,7 +10,7 @@ #include #include -int odp_event_type(odp_event_t event) +odp_event_type_t odp_event_type(odp_event_t event) { return _odp_buffer_event_type(odp_buffer_from_event(event)); }