From patchwork Fri Mar 6 16:22:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Holmes X-Patchwork-Id: 45490 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7BA2B214A0 for ; Fri, 6 Mar 2015 16:23:47 +0000 (UTC) Received: by lbvp9 with SMTP id p9sf17750209lbv.0 for ; Fri, 06 Mar 2015 08:23:46 -0800 (PST) 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:cc: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=67LYeh250LdjL+3qNRCZIKFifO67b2wmrwuSBv0111I=; b=MTBwKHZexTVdimApQneZK8uTXds2LqpjKcLVMzzaWTurdzaovB7tSGKR4tKQRE+BQI tjN5NZRZs65uG9eYXtPV7+BlibBZ6IrG6VSI50B2TJ1Q7F/G4Dzwp5DYmp1/5tSoxjlp NKT8ZFeLiBRQxDIQ9yqNYs5Q1GvPB3KTeWoAEREzUpKdW6A8S6Ray4WU7Pli4Bl5e/lq qlvy/RFIc41Tr60rjLS3fOpsdVE04ryBZf+dOL3RVoRedYrD0IugDzH9Er1vdGeVhRXq r00Q3xJgQlQ3HwLNjNAYUC6OwT8FnveO1NiXxEqnExIqnBzOZQ0SNI22UOmZTUL/Ba4h fWfw== X-Gm-Message-State: ALoCoQlVlqHltt2y4wSp7COUpu4HIzNzxeKiF5KMM5dhhhDtIv/MJL25puzb3CohDaC6r0NbXD9P X-Received: by 10.194.239.41 with SMTP id vp9mr2455945wjc.5.1425659026084; Fri, 06 Mar 2015 08:23:46 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.242.132 with SMTP id wq4ls94575lac.30.gmail; Fri, 06 Mar 2015 08:23:45 -0800 (PST) X-Received: by 10.112.36.69 with SMTP id o5mr13819046lbj.59.1425659025900; Fri, 06 Mar 2015 08:23:45 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id bl10si7474497lbc.68.2015.03.06.08.23.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 08:23:45 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labgd6 with SMTP id gd6so11583460lab.6 for ; Fri, 06 Mar 2015 08:23:45 -0800 (PST) X-Received: by 10.152.43.51 with SMTP id t19mr13352335lal.73.1425659025733; Fri, 06 Mar 2015 08:23:45 -0800 (PST) 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.35.133 with SMTP id h5csp1249lbj; Fri, 6 Mar 2015 08:23:45 -0800 (PST) X-Received: by 10.140.232.135 with SMTP id d129mr20602469qhc.90.1425659023938; Fri, 06 Mar 2015 08:23:43 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w9si9678881qha.81.2015.03.06.08.23.13 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 06 Mar 2015 08:23:43 -0800 (PST) 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 1YTv1q-0006rM-5N; Fri, 06 Mar 2015 16:23:10 +0000 Received: from mail-qg0-f42.google.com ([209.85.192.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YTv1I-0006rC-IX for lng-odp@lists.linaro.org; Fri, 06 Mar 2015 16:22:36 +0000 Received: by qgfi50 with SMTP id i50so13712643qgf.9 for ; Fri, 06 Mar 2015 08:22:31 -0800 (PST) X-Received: by 10.55.15.25 with SMTP id z25mr30183399qkg.87.1425658951211; Fri, 06 Mar 2015 08:22:31 -0800 (PST) Received: from mike-desktop.?.holmesfamily.ws (c-98-221-136-245.hsd1.nj.comcast.net. [98.221.136.245]) by mx.google.com with ESMTPSA id l78sm6027674qhl.34.2015.03.06.08.22.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Mar 2015 08:22:30 -0800 (PST) From: Mike Holmes To: taras.kondratiuk@linaro.org Date: Fri, 6 Mar 2015 11:22:15 -0500 Message-Id: <1425658935-15991-1-git-send-email-mike.holmes@linaro.org> X-Mailer: git-send-email 2.1.0 X-Topics: patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCH] linux-generic: time: remove platform specific acceleration 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.47 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 Linux-generic should be a reference implementation and does not need archetecture specific acceleration. Signed-off-by: Mike Holmes --- platform/linux-generic/odp_time.c | 47 +++------------------------------------ 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c index 31d6656..6f40361 100644 --- a/platform/linux-generic/odp_time.c +++ b/platform/linux-generic/odp_time.c @@ -6,52 +6,13 @@ #define _POSIX_C_SOURCE 200809L +#include #include -#include #include - -#define GIGA 1000000000 - -#if defined __x86_64__ || defined __i386__ - -uint64_t odp_time_cycles(void) -{ - union { - uint64_t tsc_64; - struct { - uint32_t lo_32; - uint32_t hi_32; - }; - } tsc; - - __asm__ __volatile__ ("rdtsc" : - "=a" (tsc.lo_32), - "=d" (tsc.hi_32) : : "memory"); - - return tsc.tsc_64; -} - - -#elif defined __OCTEON__ - -uint64_t odp_time_cycles(void) -{ - #define CVMX_TMP_STR(x) CVMX_TMP_STR2(x) - #define CVMX_TMP_STR2(x) #x - uint64_t cycle; - - __asm__ __volatile__ ("rdhwr %[rt],$" CVMX_TMP_STR(31) : - [rt] "=d" (cycle) : : "memory"); - - return cycle; -} - -#else - -#include -#include #include +#define GIGA 1000000000 + uint64_t odp_time_cycles(void) { struct timespec time; @@ -74,8 +35,6 @@ uint64_t odp_time_cycles(void) return cycles; } -#endif - uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2) { if (odp_likely(t2 > t1))