qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/14] ioport: divide ioport_opaque for read/wri


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 03/14] ioport: divide ioport_opaque for read/write functions
Date: Thu, 10 Sep 2009 09:04:11 +0200


On 09.09.2009, at 17:41, 武田 俊也 wrote:

Now ioport read function and write function that have the same address
must be registered with one opaque.
But there may be the case that read-only iodevice and write-only one
are assigned to same address.

This patch is to divide ioport_opaque for read/write functions.

Why would you need different opaques for read and write functions of the same IO port?


diff -ur a/ioport.c b/ioport.c
--- a/ioport.c  Tue Sep  8 21:26:50 2009
+++ b/ioport.c  Wed Sep  9 21:50:06 2009
@@ -47,7 +47,8 @@

/* XXX: use a two level table to limit memory usage */

-static void *ioport_opaque[MAX_IOPORTS];
+static void *ioport_read_opaque[MAX_IOPORTS];
+static void *ioport_write_opaque[MAX_IOPORTS];

This adds quite a lot of memory overhead.

On my x86_64 system that would mean:

#define MAX_IOPORTS     (64 * 1024)

>>> (64 * 1024) * sizeof(void*)
524288

So this simple change adds 512KB of RAM overhead for no obvious reason. Maybe you could use the same opaque? :-)

Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]