summaryrefslogtreecommitdiff
path: root/hw/ppc_chrp.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-02 04:51:10 +0000
commite4bcb14c79fb63a35aef3eb39e02c16c19b8b28d (patch)
tree06bee4b9dbf4c7b50e20c9996924d7d132cdfec2 /hw/ppc_chrp.c
parent7233b355571ad2a8e7aec7eb19db5f530e81f052 (diff)
downloadqemu-e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d.tar.gz
Add -drive parameter, by Laurent Vivier.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_chrp.c')
-rw-r--r--hw/ppc_chrp.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index 1e3e6c4f6c..4437a1038e 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -32,6 +32,8 @@
#include "sysemu.h"
#include "boards.h"
+#define MAX_IDE_BUS 2
+
/* UniN device */
static void unin_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
{
@@ -81,6 +83,8 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
int pic_mem_index, dbdma_mem_index, cuda_mem_index;
int ide_mem_index[2];
int ppc_boot_device;
+ int index;
+ BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
linux_boot = (kernel_filename != NULL);
@@ -266,11 +270,22 @@ static void ppc_core99_init (int ram_size, int vga_ram_size,
nd_table[i].model = "ne2k_pci";
pci_nic_init(pci_bus, &nd_table[i], -1);
}
+ if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
+ fprintf(stderr, "qemu: too many IDE bus\n");
+ exit(1);
+ }
+ for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
+ index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
+ if (index != -1)
+ hd[i] = drives_table[index].bdrv;
+ else
+ hd[i] = NULL;
+ }
#if 1
- ide_mem_index[0] = pmac_ide_init(&bs_table[0], pic[0x13]);
- ide_mem_index[1] = pmac_ide_init(&bs_table[2], pic[0x14]);
+ ide_mem_index[0] = pmac_ide_init(&hd[0], pic[0x13]);
+ ide_mem_index[1] = pmac_ide_init(&hd[2], pic[0x14]);
#else
- pci_cmd646_ide_init(pci_bus, &bs_table[0], 0);
+ pci_cmd646_ide_init(pci_bus, &hd[0], 0);
#endif
/* cuda also initialize ADB */
cuda_init(&cuda_mem_index, pic[0x19]);