aboutsummaryrefslogtreecommitdiff
path: root/hw/musicpal.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/musicpal.c
parent8a14daa5a1ae22fcfc317f4727a88d6c15c39aae (diff)
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/musicpal.c')
-rw-r--r--hw/musicpal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/musicpal.c b/hw/musicpal.c
index e6367919fc..2d26b3334d 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1512,8 +1512,8 @@ static void musicpal_init(ram_addr_t ram_size,
qemu_irq pic[32];
DeviceState *dev;
int i;
- int index;
unsigned long flash_size;
+ DriveInfo *dinfo;
if (!cpu_model)
cpu_model = "arm926";
@@ -1549,9 +1549,9 @@ static void musicpal_init(ram_addr_t ram_size,
serial_hds[1], 1);
/* Register flash */
- index = drive_get_index(IF_PFLASH, 0, 0);
- if (index != -1) {
- flash_size = bdrv_getlength(drives_table[index].bdrv);
+ dinfo = drive_get(IF_PFLASH, 0, 0);
+ if (dinfo) {
+ flash_size = bdrv_getlength(dinfo->bdrv);
if (flash_size != 8*1024*1024 && flash_size != 16*1024*1024 &&
flash_size != 32*1024*1024) {
fprintf(stderr, "Invalid flash image size\n");
@@ -1564,7 +1564,7 @@ static void musicpal_init(ram_addr_t ram_size,
* image is smaller than 32 MB.
*/
pflash_cfi02_register(0-MP_FLASH_SIZE_MAX, qemu_ram_alloc(flash_size),
- drives_table[index].bdrv, 0x10000,
+ dinfo->bdrv, 0x10000,
(flash_size + 0xffff) >> 16,
MP_FLASH_SIZE_MAX / flash_size,
2, 0x00BF, 0x236D, 0x0000, 0x0000,