From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V21Ur-0002Hq-Gm for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V21Uo-0002Qi-41 for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:01:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V21Un-0002QY-Nl for qemu-devel@nongnu.org; Wed, 24 Jul 2013 12:00:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6OG0u4s032358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Jul 2013 12:00:56 -0400 Received: from redhat.com (vpn-201-81.tlv.redhat.com [10.35.201.81]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id r6OG0sKL017362 for ; Wed, 24 Jul 2013 12:00:55 -0400 Date: Wed, 24 Jul 2013 19:02:17 +0300 From: "Michael S. Tsirkin" Message-ID: <1374681580-17439-13-git-send-email-mst@redhat.com> References: <1374681580-17439-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1374681580-17439-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH v3 12/14] pvpanic: add API to access io port List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Add API to find pvpanic device and get its io port. Will be used to fill in guest info structure. Signed-off-by: Michael S. Tsirkin --- hw/misc/pvpanic.c | 11 +++++++++++ include/hw/i386/pc.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 7bb49a5..bb403e9 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -122,6 +122,17 @@ void pvpanic_init(ISABus *bus) pvpanic_fw_cfg(dev, fw_cfg); } +uint16_t pvpanic_port(void) +{ + Object *o = object_resolve_path_type("", TYPE_ISA_PVPANIC_DEVICE, NULL); + PVPanicState *s; + if (!o) { + return 0; + } + s = ISA_PVPANIC_DEVICE(o); + return s->ioport; +} + static Property pvpanic_isa_properties[] = { DEFINE_PROP_UINT16("ioport", PVPanicState, ioport, 0x505), DEFINE_PROP_END_OF_LIST(), diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 76af5cd..e718a59 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -228,6 +228,7 @@ void pc_system_firmware_init(MemoryRegion *rom_memory); /* pvpanic.c */ void pvpanic_init(ISABus *bus); +uint16_t pvpanic_port(void); /* e820 types */ #define E820_RAM 1 -- MST