From patchwork Tue May 11 20:43:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 52315 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F37B5B7DB0 for ; Wed, 12 May 2010 06:44:26 +1000 (EST) Received: from localhost ([127.0.0.1]:34076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBwJT-0005Yn-Hc for incoming@patchwork.ozlabs.org; Tue, 11 May 2010 16:44:23 -0400 Received: from [140.186.70.92] (port=49409 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBwIZ-0005W5-1U for qemu-devel@nongnu.org; Tue, 11 May 2010 16:43:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBwIX-0001DG-RD for qemu-devel@nongnu.org; Tue, 11 May 2010 16:43:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63082) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBwIX-0001D7-Jp for qemu-devel@nongnu.org; Tue, 11 May 2010 16:43:25 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4BKhOBq017147 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 May 2010 16:43:24 -0400 Received: from zweiblum.home.kraxel.org (vpn1-7-10.ams2.redhat.com [10.36.7.10]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4BKhMOm027804; Tue, 11 May 2010 16:43:23 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id C860A70122; Tue, 11 May 2010 22:43:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 11 May 2010 22:43:20 +0200 Message-Id: <1273610601-12805-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/2] ioport: add function to check whenever a port is assigned or not X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- ioport.c | 5 +++++ ioport.h | 1 + 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/ioport.c b/ioport.c index 53dd87a..b718047 100644 --- a/ioport.c +++ b/ioport.c @@ -190,6 +190,11 @@ void isa_unassign_ioport(pio_addr_t start, int length) } } +int is_ioport_assigned(pio_addr_t addr) +{ + return ioport_opaque[addr] != NULL; +} + /***********************************************************/ void cpu_outb(pio_addr_t addr, uint8_t val) diff --git a/ioport.h b/ioport.h index 3d3c8a3..46fbfa8 100644 --- a/ioport.h +++ b/ioport.h @@ -41,6 +41,7 @@ int register_ioport_read(pio_addr_t start, int length, int size, int register_ioport_write(pio_addr_t start, int length, int size, IOPortWriteFunc *func, void *opaque); void isa_unassign_ioport(pio_addr_t start, int length); +int is_ioport_assigned(pio_addr_t addr); void cpu_outb(pio_addr_t addr, uint8_t val);