From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
qemu-devel <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] memory: Eliminate region offset
Date: Sun, 18 Sep 2011 15:09:21 +0200 [thread overview]
Message-ID: <4E75ED81.9050902@web.de> (raw)
In-Reply-To: <4E75EA08.4090809@web.de>
From: Jan Kiszka <jan.kiszka@siemens.com>
Before anything makes use of this legacy mechanism again, remove it.
This will enforce proper conversion of device models while they are
ported over the memory API.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
memory.c | 14 ++++----------
memory.h | 9 ---------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/memory.c b/memory.c
index 51f0297..4dd63cc 100644
--- a/memory.c
+++ b/memory.c
@@ -405,7 +405,7 @@ static void memory_region_iorange_read(IORange *iorange,
return;
}
*data = 0;
- access_with_adjusted_size(offset + mr->offset, data, width,
+ access_with_adjusted_size(offset, data, width,
mr->ops->impl.min_access_size,
mr->ops->impl.max_access_size,
memory_region_read_accessor, mr);
@@ -431,7 +431,7 @@ static void memory_region_iorange_write(IORange *iorange,
}
return;
}
- access_with_adjusted_size(offset + mr->offset, &data, width,
+ access_with_adjusted_size(offset, &data, width,
mr->ops->impl.min_access_size,
mr->ops->impl.max_access_size,
memory_region_write_accessor, mr);
@@ -778,7 +778,6 @@ void memory_region_init(MemoryRegion *mr,
mr->parent = NULL;
mr->size = size;
mr->addr = 0;
- mr->offset = 0;
mr->terminates = false;
mr->readable = true;
mr->destructor = memory_region_destructor_none;
@@ -830,7 +829,7 @@ static uint32_t memory_region_read_thunk_n(void *_mr,
}
/* FIXME: support unaligned access */
- access_with_adjusted_size(addr + mr->offset, &data, size,
+ access_with_adjusted_size(addr, &data, size,
mr->ops->impl.min_access_size,
mr->ops->impl.max_access_size,
memory_region_read_accessor, mr);
@@ -855,7 +854,7 @@ static void memory_region_write_thunk_n(void *_mr,
}
/* FIXME: support unaligned access */
- access_with_adjusted_size(addr + mr->offset, &data, size,
+ access_with_adjusted_size(addr, &data, size,
mr->ops->impl.min_access_size,
mr->ops->impl.max_access_size,
memory_region_write_accessor, mr);
@@ -1004,11 +1003,6 @@ uint64_t memory_region_size(MemoryRegion *mr)
return mr->size;
}
-void memory_region_set_offset(MemoryRegion *mr, target_phys_addr_t offset)
-{
- mr->offset = offset;
-}
-
void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client)
{
uint8_t mask = 1 << client;
diff --git a/memory.h b/memory.h
index 06b83ae..b07cd55 100644
--- a/memory.h
+++ b/memory.h
@@ -107,7 +107,6 @@ struct MemoryRegion {
MemoryRegion *parent;
uint64_t size;
target_phys_addr_t addr;
- target_phys_addr_t offset;
bool backend_registered;
void (*destructor)(MemoryRegion *mr);
ram_addr_t ram_addr;
@@ -268,14 +267,6 @@ uint64_t memory_region_size(MemoryRegion *mr);
void *memory_region_get_ram_ptr(MemoryRegion *mr);
/**
- * memory_region_set_offset: Sets an offset to be added to MemoryRegionOps
- * callbacks.
- *
- * This function is deprecated and should not be used in new code.
- */
-void memory_region_set_offset(MemoryRegion *mr, target_phys_addr_t offset);
-
-/**
* memory_region_set_log: Turn dirty logging on or off for a region.
*
* Turns dirty logging on or off for a specified client (display, migration).
--
1.7.3.4
next prev parent reply other threads:[~2011-09-18 13:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-18 12:54 [Qemu-devel] [PATCH] isa: Avoid using obsolete memory_region_set_offset for old portio Jan Kiszka
2011-09-18 13:09 ` Jan Kiszka [this message]
2011-09-18 15:57 ` Avi Kivity
2011-09-18 16:29 ` Jan Kiszka
2011-09-18 16:46 ` Avi Kivity
2011-09-18 19:04 ` Jan Kiszka
2011-09-19 12:14 ` Avi Kivity
2011-09-19 12:29 ` Jan Kiszka
2011-09-19 12:37 ` Avi Kivity
2011-09-19 12:48 ` Jan Kiszka
2011-09-19 12:59 ` Avi Kivity
2011-09-18 16:49 ` Richard Henderson
2011-09-18 19:16 ` Jan Kiszka
2011-09-19 12:15 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E75ED81.9050902@web.de \
--to=jan.kiszka@web.de \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).