From patchwork Thu Dec 19 11:53:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Ishchuk X-Patchwork-Id: 3377541 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E99619F314 for ; Thu, 19 Dec 2013 11:54:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9D6D20620 for ; Thu, 19 Dec 2013 11:54:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C278520619 for ; Thu, 19 Dec 2013 11:54:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591Ab3LSLyM (ORCPT ); Thu, 19 Dec 2013 06:54:12 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:38856 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338Ab3LSLyK (ORCPT ); Thu, 19 Dec 2013 06:54:10 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Dec 2013 11:54:09 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 19 Dec 2013 11:54:07 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id DAD25219005C for ; Thu, 19 Dec 2013 11:54:05 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBJBrsnN66125966 for ; Thu, 19 Dec 2013 11:53:54 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBJBs483027695 for ; Thu, 19 Dec 2013 04:54:06 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rBJBrdCT026833; Thu, 19 Dec 2013 04:54:04 -0700 From: Alexey Ishchuk To: linux-rdma@vger.kernel.org Cc: arlin.r.davis@intel.com, gilr@dev.mellanox.co.il, roland@kernel.org, klaus.wacker@de.ibm.com, alexey_ishchuk@ru.ibm.com Subject: [PATCH 4/4] DAPL: Support for Linux on System z in perftest package Date: Thu, 19 Dec 2013 12:53:18 +0100 Message-Id: <1387453998-27416-6-git-send-email-alexey_ishchuk@ru.ibm.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1387453998-27416-1-git-send-email-alexey_ishchuk@ru.ibm.com> References: <1387453998-27416-1-git-send-email-alexey_ishchuk@ru.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13121911-4966-0000-0000-000007E0A66C Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP s390: Add support for Linux on System z This patch adds the required code to support Linux on System z. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -aurp /usr/src/packages/BUILD/perftest-2.0/src/get_clock.c perftest-2.0/src/get_clock.c --- /usr/src/packages/BUILD/perftest-2.0/src/get_clock.c 2013-06-27 14:36:35.000000000 +0200 +++ perftest-2.0/src/get_clock.c 2013-12-17 11:18:44.765167244 +0100 @@ -132,6 +132,7 @@ static double sample_get_cpu_mhz(void) return b; } +#ifndef __s390x__ static double proc_get_cpu_mhz(int no_cpu_freq_fail) { FILE* f; @@ -177,9 +178,13 @@ static double proc_get_cpu_mhz(int no_cp return mhz; } +#endif double get_cpu_mhz(int no_cpu_freq_fail) { +#ifdef __s390x__ + return sample_get_cpu_mhz(); +#else double sample, proc, delta; sample = sample_get_cpu_mhz(); proc = proc_get_cpu_mhz(no_cpu_freq_fail); @@ -195,4 +200,5 @@ double get_cpu_mhz(int no_cpu_freq_fail) return sample; } return proc; +#endif } diff -aurp /usr/src/packages/BUILD/perftest-2.0/src/get_clock.h perftest-2.0/src/get_clock.h --- /usr/src/packages/BUILD/perftest-2.0/src/get_clock.h 2013-01-09 10:46:27.000000000 +0100 +++ perftest-2.0/src/get_clock.h 2013-12-17 11:18:44.765167244 +0100 @@ -70,7 +70,15 @@ static inline cycles_t get_cycles() asm volatile ("mov %0=ar.itc" : "=r" (ret)); return ret; } +#elif defined(__s390x__) +typedef unsigned long long cycles_t; +static inline cycles_t get_cycles(void) +{ + cycles_t clk; + asm volatile("stck %0" : "=Q" (clk) : : "cc"); + return clk >> 2; +} #else #warning get_cycles not implemented for this architecture: attempt asm/timex.h #include