aboutsummaryrefslogtreecommitdiff
path: root/hw/onenand.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-07-22 16:42:57 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-27 14:08:23 -0500
commit751c6a17042b5d011013d6963c0505d671cf708e (patch)
tree61a769ed1a1c16ebdfc1397ce9d775222dfa8e57 /hw/onenand.c
parent8a14daa5a1ae22fcfc317f4727a88d6c15c39aae (diff)
downloadqemu-751c6a17042b5d011013d6963c0505d671cf708e.zip
qemu-751c6a17042b5d011013d6963c0505d671cf708e.tar.gz
qemu-751c6a17042b5d011013d6963c0505d671cf708e.tar.bz2
kill drives_table
First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/onenand.c')
-rw-r--r--hw/onenand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/onenand.c b/hw/onenand.c
index 870cfd9..84fdb21 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -618,7 +618,7 @@ static CPUWriteMemoryFunc *onenand_writefn[] = {
void *onenand_init(uint32_t id, int regshift, qemu_irq irq)
{
OneNANDState *s = (OneNANDState *) qemu_mallocz(sizeof(*s));
- int bdrv_index = drive_get_index(IF_MTD, 0, 0);
+ DriveInfo *dinfo = drive_get(IF_MTD, 0, 0);
uint32_t size = 1 << (24 + ((id >> 12) & 7));
void *ram;
@@ -632,11 +632,11 @@ void *onenand_init(uint32_t id, int regshift, qemu_irq irq)
s->density_mask = (id & (1 << 11)) ? (1 << (6 + ((id >> 12) & 7))) : 0;
s->iomemtype = cpu_register_io_memory(onenand_readfn,
onenand_writefn, s);
- if (bdrv_index == -1)
+ if (!dinfo)
s->image = memset(qemu_malloc(size + (size >> 5)),
0xff, size + (size >> 5));
else
- s->bdrv = drives_table[bdrv_index].bdrv;
+ s->bdrv = dinfo->bdrv;
s->otp = memset(qemu_malloc((64 + 2) << PAGE_SHIFT),
0xff, (64 + 2) << PAGE_SHIFT);
s->ram = qemu_ram_alloc(0xc000 << s->shift);