From patchwork Wed Aug 30 08:26:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?UTF-8?q?Sergio=20Andr=C3=A9s=20G=C3=B3mez=20Del=20Real?= X-Patchwork-Id: 9928873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6C4FE60380 for ; Wed, 30 Aug 2017 08:31:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B77928111 for ; Wed, 30 Aug 2017 08:31:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5008E28138; Wed, 30 Aug 2017 08:31:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DBF6228113 for ; Wed, 30 Aug 2017 08:31:22 +0000 (UTC) Received: from localhost ([::1]:48990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyPB-0004Xj-Nz for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Aug 2017 04:31:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmyLi-0002UB-JT for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmyLg-0000NL-1A for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:46 -0400 Received: from mail-ua0-x244.google.com ([2607:f8b0:400c:c08::244]:36832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmyLf-0000N8-T8 for qemu-devel@nongnu.org; Wed, 30 Aug 2017 04:27:43 -0400 Received: by mail-ua0-x244.google.com with SMTP id y50so2343467uay.3 for ; Wed, 30 Aug 2017 01:27:43 -0700 (PDT) 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=2wAdGKBDZdwPdxg49ZXuQja2uoNNK/CXjUJtPiiThno=; b=LJJXWjL/Fgf3FsSPLY+Utt86WJoXnpT4xkfBmZxoXmRKT2S0uVcPJI2HQ3QM6MWwhS A6yNcQZoD/2JbizJnFXfVVD+74IJI3Bi+90ToZ7DvPdm/30oXR+NdFfFgv7v9YP3I5mx d/N7tTY7ET0eXYEvHV3xavn3REM/RTtEr/8ljFyIHMpUvzOfmbABmAL7++r16QdME2OP u9mCSmVF3QCf1tbx9F8eEJ5eJlAwQhtF0uVnaHzGlf/QUHKXWpLcoDgBnAits6DAxIBS UgViKk/LmKBF5Ju/stT5pBw1cvJm75UR8dPyuquuF7U2SkhjAAe6rStOQZhemfGcwWar tDLA== 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=2wAdGKBDZdwPdxg49ZXuQja2uoNNK/CXjUJtPiiThno=; b=AzAoi4eU8dHIe1R6dKQB2yS/4GYz3lbBgk7+gA85t3CRpbKLhrkmLs2kSP8k1uQDx4 U/XtFhPMk/XJulTaCW0wVLPw/JwX1sixtYMSkaQKDsLzC74vHe2GZqGd+uv8KAiFpewX bzRsKJfSBR8XGMFFcQ2aCscpbCsuQJZtduRU0pUfFWtofUhsO+Z59axD01Zd3A+zjD64 FXmjjN31dsGLHti59jV5/fykZNdMQi4q5HHCeukLeGrL/L5kSvph3osnjmfqamYm5/Sh hkLlOJ7uDdAdYerWV+wpvrlsw0QtUwOF3J2LkLwCEyN4MrUl7QDJVFMZOv6COBimgW/d XigA== X-Gm-Message-State: AHYfb5iNqU6Yv1/4MbwjNFUnr2SfnADnsd//0ty919KRXptQV82h9uZ6 fwuAjq0k3pvBiSc5 X-Received: by 10.176.77.146 with SMTP id s18mr433969uag.106.1504081663213; Wed, 30 Aug 2017 01:27:43 -0700 (PDT) Received: from localhost.localdomain ([191.109.6.85]) by smtp.gmail.com with ESMTPSA id h74sm1079197vka.8.2017.08.30.01.27.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 01:27:42 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Wed, 30 Aug 2017 03:26:56 -0500 Message-Id: <20170830082702.3011-8-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170830082702.3011-1-Sergio.G.DelReal@gmail.com> References: <20170830082702.3011-1-Sergio.G.DelReal@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::244 Subject: [Qemu-devel] [PATCH v2 07/13] apic: add function to apic that will be used by hvf 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: Sergio Andres Gomez Del Real Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This commit adds the function apic_get_highest_priority_irr to apic.c and exports it through the interface in apic.h for use by hvf. Signed-off-by: Sergio Andres Gomez Del Real --- hw/intc/apic.c | 11 +++++++++++ include/hw/i386/apic.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/intc/apic.c b/hw/intc/apic.c index fe15fb6024..3de59d07fd 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -305,6 +305,17 @@ static void apic_set_tpr(APICCommonState *s, uint8_t val) } } +int apic_get_highest_priority_irr(DeviceState *dev) +{ + APICCommonState *s; + + if (!dev) { + return -1; + } + s = APIC_COMMON(dev); + return get_highest_priority_int(s->irr); +} + static uint8_t apic_get_tpr(APICCommonState *s) { apic_sync_vapic(s, SYNC_FROM_VAPIC); diff --git a/include/hw/i386/apic.h b/include/hw/i386/apic.h index ea48ea9389..a9f6c0aa33 100644 --- a/include/hw/i386/apic.h +++ b/include/hw/i386/apic.h @@ -20,6 +20,7 @@ void apic_init_reset(DeviceState *s); void apic_sipi(DeviceState *s); void apic_poll_irq(DeviceState *d); void apic_designate_bsp(DeviceState *d, bool bsp); +int apic_get_highest_priority_irr(DeviceState *dev); /* pc.c */ DeviceState *cpu_get_current_apic(void);