From patchwork Mon May 23 20:28:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 97049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C2143B6FBA for ; Tue, 24 May 2011 06:35:15 +1000 (EST) Received: from localhost ([::1]:50109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObqL-0005Vc-4O for incoming@patchwork.ozlabs.org; Mon, 23 May 2011 16:35:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:42934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObkq-0005dg-Kw for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QObkp-0008PT-Ok for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:32 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:59083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QObkp-0008HM-M8 for qemu-devel@nongnu.org; Mon, 23 May 2011 16:29:31 -0400 Received: by mail-gy0-f173.google.com with SMTP id 4so2710878gyg.4 for ; Mon, 23 May 2011 13:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=d2Gc/Z6mBO7g3Cqxbly8PdC23Bt++cAwrQ78sDHqimc=; b=xCPz3ywqdaaqLS4tw9nuYlLlR+kOUflpvK+y3DV2f1fzDS09RcSfS6UZxNElDi6EOj ILoFRc7ntDTI7t9s5u0IEXjcitwg5Y/phIiz8g2H863RQO0oT913i2Bekazpekm6lkIp wMzTecKy1QzIi6WaN24IVVL3fJZVC0DH6LKNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=Uf7cXY111kLN6QY4JleacVuN75LImD1SJwf/bg+Av0/J53pTWOm1FrBjUob114xRwb aMGeBOtsI7G1MvrmzD7zl8VqaypTaeZvU9Ko3fbRAThcdIm47kNvoqlvdRF9Cu8WBBDW gBoFG4yaHrmCUH/dQ3kGJdnuRZHKMCgcGxMWM= Received: by 10.91.15.5 with SMTP id s5mr3642374agi.11.1306182571339; Mon, 23 May 2011 13:29:31 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id e9sm5033668ann.24.2011.05.23.13.29.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 13:29:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 23 May 2011 13:28:45 -0700 Message-Id: <1306182526-12081-26-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306182526-12081-1-git-send-email-rth@twiddle.net> References: <1306182526-12081-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.173 Subject: [Qemu-devel] [PATCH 25/26] target-alpha: Use a fixed frequency for the RPCC in system mode. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Also include the PCC_OFS in the return value. For user mode we can pretend the PCC_OFS value is always zero. Signed-off-by: Richard Henderson --- target-alpha/op_helper.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 91ef90a..36b8289 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -65,8 +65,17 @@ static void QEMU_NORETURN arith_excp(int exc, uint64_t mask) uint64_t helper_load_pcc (void) { - /* ??? This isn't a timer for which we have any rate info. */ +#ifndef CONFIG_USER_ONLY + /* In system mode we have access to a decent high-resolution clock. + In order to make OS-level time accounting work with the RPCC, + present it with a well-timed clock fixed at 250MHz. */ + return (((uint64_t)env->pcc_ofs << 32) + | (uint32_t)(qemu_get_clock_ns(vm_clock) >> 2)); +#else + /* In user-mode, vm_clock doesn't exist. Just pass through the host cpu + clock ticks. Also, don't bother taking PCC_OFS into account. */ return (uint32_t)cpu_get_real_ticks(); +#endif } uint64_t helper_load_fpcr (void)