From patchwork Fri Mar 28 16:10:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 27350 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D9E520545 for ; Fri, 28 Mar 2014 16:27:23 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id lh14sf11546159vcb.2 for ; Fri, 28 Mar 2014 09:27:22 -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=I2qCjKsrZh4cBpM5DUDXoFWseSPhymZDKp+7CJTV1xI=; b=lIYs3La7wuftFaGahJSptKzcSBSkh/NGgndhoM1MGQPF19ysGjdZQGNCFK2jqtVxQC 8624+dmvL+Pkw0cjAbqZbRAIzEqpCEoIFiSQpgMgvnMeP83oDnQvYWtTViiib6XSqQ7P 0mbn/IXEKVSLoCDE59uxBhcvgZcrTxo7ndgUzkL8t4pjnb4iPUlDqbYX/e5L/Zr99K7I IoeCm0NGBzLLOR8nS9ltgisweCKpPeIeYq8umZ3/gXRIfJI6G0fp8JYiFvbQBG1npRIh Ym3RqmU+sQ/SboABipkrA8/m7Eez5lITTOTbReaVEH1gSvBZVmOiq1Y2DdowxOqQDhoT ix0g== X-Gm-Message-State: ALoCoQmh2G2izGoixQNsdcnUsY9lgQSgd2jy6kEVq9hsnZ63AV+gRU2awcTJJBBr708kASz4n9s+ X-Received: by 10.224.6.198 with SMTP id a6mr3490411qaa.6.1396024042599; Fri, 28 Mar 2014 09:27:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.209 with SMTP id f75ls1614254qgd.48.gmail; Fri, 28 Mar 2014 09:27:22 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr7782522vcw.15.1396024042510; Fri, 28 Mar 2014 09:27:22 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id vd8si1327891vdc.88.2014.03.28.09.27.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:27:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id la4so6025952vcb.17 for ; Fri, 28 Mar 2014 09:27:22 -0700 (PDT) X-Received: by 10.52.72.48 with SMTP id a16mr6624698vdv.19.1396024042442; Fri, 28 Mar 2014 09:27:22 -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.12.8 with SMTP id v8csp21810vcv; Fri, 28 Mar 2014 09:27:21 -0700 (PDT) X-Received: by 10.153.5.33 with SMTP id cj1mr38935lad.65.1396024027059; Fri, 28 Mar 2014 09:27:07 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id w10si3662367lal.63.2014.03.28.09.27.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Mar 2014 09:27:07 -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 1WTZMQ-0000cf-0W; Fri, 28 Mar 2014 16:10:26 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite Subject: [PATCH v5 26/37] target-arm: Implement ISR_EL1 register Date: Fri, 28 Mar 2014 16:10:13 +0000 Message-Id: <1396023024-2262-27-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396023024-2262-1-git-send-email-peter.maydell@linaro.org> References: <1396023024-2262-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.220.172 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 --- 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 };