From patchwork Mon Jan 28 02:09:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1031646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pEbDiri1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ntTM5p9Fz9s55 for ; Mon, 28 Jan 2019 13:13:27 +1100 (AEDT) Received: from localhost ([127.0.0.1]:52796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnwQP-00058s-MY for incoming@patchwork.ozlabs.org; Sun, 27 Jan 2019 21:13:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnwPk-0004zY-6B for qemu-devel@nongnu.org; Sun, 27 Jan 2019 21:12:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnwN8-0005dG-A7 for qemu-devel@nongnu.org; Sun, 27 Jan 2019 21:10:02 -0500 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:37993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnwN8-0005cn-3N for qemu-devel@nongnu.org; Sun, 27 Jan 2019 21:10:02 -0500 Received: by mail-lf1-x142.google.com with SMTP id a8so10674368lfk.5 for ; Sun, 27 Jan 2019 18:10:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DXQNaBTgE87foxb/j7bQBHb2YMBoc0sfZlJw6UwbJro=; b=pEbDiri1rA4QwDG7hKmyGtuk4vUWMcR72iCh8LA8JxEx6a1B/xzhUGDV1CDUAQOJTv y/XUqQEsbWO0ASoJE5QArbnl3S2e2YBrIitR455vmdUOD9gWd/5JNNMbL6UJUtTR8Hbu Kw2oP5Y4AhvqtO7Oou9KJwXwmUpEuI6rclSPk8C9FkP7V0ZefMvIc2Ysme5GOvEFNNQN agdhIpqasr1Uwp85SL2DZoMx25ClN0RmppTyRkUPePPr3JAoIoRaMmtiTH/BN0Ga+bc8 jwhaD6VVG/gC5AaNS+wryPtjA7DVwEVP0VaCyv/5GKhXmt+Z8509WWxImbHvDZo9jdwg LY7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DXQNaBTgE87foxb/j7bQBHb2YMBoc0sfZlJw6UwbJro=; b=RkbMZV7eJoeVJ0AJ0fLyY6JmIUiHiJfeyK4JOtWfKG60podTk7MSkjB0t55frCS85E pjA3/OYBhtFJ9tVuN7T4f0zXUllbJSKxQiC+H2XueI2979Q+FeoNek6q33J715y0am6p D8xPnajPLAA8CPgRdWHYLC1V/9UekpUhxb1fX6yIpVBiq8lp1NC5+FaT5BJwf49Vv+1r wpuYVKW2m6D2dVzdyd+h7IGCQb9g3n13hZLuRSKU+5zGDSpFAIYmadYTBkNpbTvpaaK/ i/DYdwdBz0/gXbMm/hlTgCvDcggqKtDKAj7gEGXAQdZjKP/sniXPsSt8x9iiwUsd6jxI 4QGQ== X-Gm-Message-State: AJcUukcHv4nU9alDruJRV5M5n4nEcl6dzdgzsfX57FbYQadCAxgkQJIn xd6Kp4ah15EmzZqTlKe1ZyYuerWEkKM= X-Google-Smtp-Source: ALg8bN7vV1YnJ6xsxBjBanFGqBkKh3GVACKkOMfklVCHksUrr4d31SjpB92vyYt12TqYGJg1lTGJ7A== X-Received: by 2002:a19:5402:: with SMTP id i2mr14633060lfb.128.1548641400108; Sun, 27 Jan 2019 18:10:00 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id q20sm2649852lfj.20.2019.01.27.18.09.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Jan 2019 18:09:59 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 27 Jan 2019 18:09:34 -0800 Message-Id: <20190128020937.22775-2-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190128020937.22775-1-jcmvbkbc@gmail.com> References: <20190128020937.22775-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::142 Subject: [Qemu-devel] [PATCH 1/4] target/xtensa: expose core runstall as an IRQ line X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Runstall signal looks very much like a level-triggered IRQ line. Provide xtensa_get_runstall function that returns runstall IRQ. Signed-off-by: Max Filippov --- hw/xtensa/pic_cpu.c | 12 ++++++++++++ target/xtensa/cpu.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/hw/xtensa/pic_cpu.c b/hw/xtensa/pic_cpu.c index 077f4ad53d6d..a8939f5e58d0 100644 --- a/hw/xtensa/pic_cpu.c +++ b/hw/xtensa/pic_cpu.c @@ -86,6 +86,12 @@ static void xtensa_ccompare_cb(void *opaque) qemu_set_irq(env->irq_inputs[env->config->timerint[i]], 1); } +static void xtensa_set_runstall(void *opaque, int irq, int active) +{ + CPUXtensaState *env = opaque; + xtensa_runstall(env, active); +} + void xtensa_irq_init(CPUXtensaState *env) { unsigned i; @@ -106,9 +112,15 @@ void xtensa_irq_init(CPUXtensaState *env) env->ext_irq_inputs[i] = env->irq_inputs[irq]; } + env->runstall_irq = qemu_allocate_irq(xtensa_set_runstall, env, 0); } qemu_irq *xtensa_get_extints(CPUXtensaState *env) { return env->ext_irq_inputs; } + +qemu_irq xtensa_get_runstall(CPUXtensaState *env) +{ + return env->runstall_irq; +} diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 176af8a53cf0..b665bfc0068a 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -485,6 +485,7 @@ typedef struct CPUXtensaState { int pending_irq_level; /* level of last raised IRQ */ qemu_irq *irq_inputs; qemu_irq ext_irq_inputs[MAX_NINTERRUPT]; + qemu_irq runstall_irq; XtensaCcompareTimer ccompare[MAX_NCCOMPARE]; uint64_t time_base; uint64_t ccount_time; @@ -571,6 +572,7 @@ void xtensa_sim_open_console(Chardev *chr); void check_interrupts(CPUXtensaState *s); void xtensa_irq_init(CPUXtensaState *env); qemu_irq *xtensa_get_extints(CPUXtensaState *env); +qemu_irq xtensa_get_runstall(CPUXtensaState *env); int cpu_xtensa_signal_handler(int host_signum, void *pinfo, void *puc); void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf); void xtensa_sync_window_from_phys(CPUXtensaState *env);