From patchwork Thu Apr 10 16:15:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 28198 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E7D8E20671 for ; Thu, 10 Apr 2014 16:15:52 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j7sf10418915qaq.10 for ; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=9YH9NoVc3bFUxUWrR20Ji1RM4qEiQrtLsOfEFXAojXA=; b=IZikhf8SHAYcDCMyxZeR9fC2RqFWoNuWk8iMz+EhV4m4kngit91vLXhozEEDiySmwc dCW/FGZgsA7R5loEJzpb+urWMtKL2Ajg3rcLicLYVtrdYs0D/dDRAUZojYlB9oovZ+Re I/6ZToHzIkJmZsGPtR4eCc/af0M/Ko/CGxqgAevIJwvsJP16CG7BG9Yqx4r4Txgs+5GK PPJusHeo0fYCQvdyVnshmv/w1EYFoOPKPJiPXarOxaJ+qnUuq6CwP+hvsUAB4dHd9NPm aJc1u/fx5cRURqQ/XKm3Bdz/DW9YAiIXzT1KLBOt4ERR7Q03BPCjnB+ArV35nPIHfCe9 k+/A== X-Gm-Message-State: ALoCoQnuztrCQtczSF1nwXri8sEOM7TztaDoAkTu/7K/aGevayamAlVlpiJ/kQpsmQurHpFRh82x X-Received: by 10.58.41.39 with SMTP id c7mr8575432vel.25.1397146552742; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls1217185qgm.94.gmail; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr2198601vch.22.1397146552639; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id dh4si776824veb.49.2014.04.10.09.15.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 09:15:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so3564423veb.6 for ; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) X-Received: by 10.221.4.66 with SMTP id ob2mr1136299vcb.28.1397146552568; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp72250vcb; Thu, 10 Apr 2014 09:15:52 -0700 (PDT) X-Received: by 10.180.188.169 with SMTP id gb9mr15987023wic.17.1397146551717; Thu, 10 Apr 2014 09:15:51 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id hp6si2960912wib.36.2014.04.10.09.15.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 10 Apr 2014 09:15:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WYHdZ-0007rt-Pw; Thu, 10 Apr 2014 17:15:37 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Peter Crosthwaite , Greg Bellows Subject: [PATCH v6 26/37] target-arm: Implement ISR_EL1 register Date: Thu, 10 Apr 2014 17:15:25 +0100 Message-Id: <1397146536-30116-27-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397146536-30116-1-git-send-email-peter.maydell@linaro.org> References: <1397146536-30116-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Implement the ISR_EL1 register. This is actually present in ARMv7 as well but was previously unimplemented. It is a read-only register that indicates whether interrupts are currently pending. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- target-arm/helper.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index f2e6f17..398c8f5 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -665,6 +665,21 @@ static void csselr_write(CPUARMState *env, const ARMCPRegInfo *ri, env->cp15.c0_cssel = value & 0xf; } +static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri) +{ + CPUState *cs = ENV_GET_CPU(env); + uint64_t ret = 0; + + if (cs->interrupt_request & CPU_INTERRUPT_HARD) { + ret |= CPSR_I; + } + if (cs->interrupt_request & CPU_INTERRUPT_FIQ) { + ret |= CPSR_F; + } + /* External aborts are not possible in QEMU so A bit is always clear */ + return ret; +} + static const ARMCPRegInfo v7_cp_reginfo[] = { /* DBGDRAR, DBGDSAR: always RAZ since we don't implement memory mapped * debug components @@ -782,6 +797,9 @@ static const ARMCPRegInfo v7_cp_reginfo[] = { .cp = 15, .opc1 = 0, .crn = 10, .crm = 2, .opc2 = 1, .access = PL1_RW, .fieldoffset = offsetofhigh32(CPUARMState, cp15.mair_el1), .resetfn = arm_cp_reset_ignore }, + { .name = "ISR_EL1", .state = ARM_CP_STATE_BOTH, + .opc0 = 3, .opc1 = 0, .crn = 12, .crm = 1, .opc2 = 0, + .type = ARM_CP_NO_MIGRATE, .access = PL1_R, .readfn = isr_read }, REGINFO_SENTINEL };