From patchwork Wed May 19 09:54:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] ioport: add function to check whenever a port is assigned or not From: Gerd Hoffmann X-Patchwork-Id: 52969 Message-Id: <1274262857-31964-1-git-send-email-kraxel@redhat.com> To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Date: Wed, 19 May 2010 11:54:16 +0200 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);