Commit ba494313d386475e849b536fe0eb1cd05d8dfa68

Authored by Edgar E. Iglesias
1 parent e510e05b

etrax: Don't pass CPUState to peripherals.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
hw/axis_dev88.c
@@ -309,16 +309,16 @@ void axisdev88_init (ram_addr_t ram_size, @@ -309,16 +309,16 @@ void axisdev88_init (ram_addr_t ram_size,
309 nmi[0] = qdev_get_gpio_in(dev, 30); 309 nmi[0] = qdev_get_gpio_in(dev, 30);
310 nmi[1] = qdev_get_gpio_in(dev, 31); 310 nmi[1] = qdev_get_gpio_in(dev, 31);
311 311
312 - etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10); 312 + etraxfs_dmac = etraxfs_dmac_init(0x30000000, 10);
313 for (i = 0; i < 10; i++) { 313 for (i = 0; i < 10; i++) {
314 /* On ETRAX, odd numbered channels are inputs. */ 314 /* On ETRAX, odd numbered channels are inputs. */
315 etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); 315 etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1);
316 } 316 }
317 317
318 /* Add the two ethernet blocks. */ 318 /* Add the two ethernet blocks. */
319 - eth[0] = etraxfs_eth_init(&nd_table[0], env, 0x30034000, 1); 319 + eth[0] = etraxfs_eth_init(&nd_table[0], 0x30034000, 1);
320 if (nb_nics > 1) 320 if (nb_nics > 1)
321 - eth[1] = etraxfs_eth_init(&nd_table[1], env, 0x30036000, 2); 321 + eth[1] = etraxfs_eth_init(&nd_table[1], 0x30036000, 2);
322 322
323 /* The DMA Connector block is missing, hardwire things for now. */ 323 /* The DMA Connector block is missing, hardwire things for now. */
324 etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]); 324 etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]);
hw/etraxfs.c
@@ -100,16 +100,16 @@ void bareetraxfs_init (ram_addr_t ram_size, @@ -100,16 +100,16 @@ void bareetraxfs_init (ram_addr_t ram_size,
100 nmi[0] = qdev_get_gpio_in(dev, 30); 100 nmi[0] = qdev_get_gpio_in(dev, 30);
101 nmi[1] = qdev_get_gpio_in(dev, 31); 101 nmi[1] = qdev_get_gpio_in(dev, 31);
102 102
103 - etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10); 103 + etraxfs_dmac = etraxfs_dmac_init(0x30000000, 10);
104 for (i = 0; i < 10; i++) { 104 for (i = 0; i < 10; i++) {
105 /* On ETRAX, odd numbered channels are inputs. */ 105 /* On ETRAX, odd numbered channels are inputs. */
106 etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); 106 etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1);
107 } 107 }
108 108
109 /* Add the two ethernet blocks. */ 109 /* Add the two ethernet blocks. */
110 - eth[0] = etraxfs_eth_init(&nd_table[0], env, 0x30034000, 1); 110 + eth[0] = etraxfs_eth_init(&nd_table[0], 0x30034000, 1);
111 if (nb_nics > 1) 111 if (nb_nics > 1)
112 - eth[1] = etraxfs_eth_init(&nd_table[1], env, 0x30036000, 2); 112 + eth[1] = etraxfs_eth_init(&nd_table[1], 0x30036000, 2);
113 113
114 /* The DMA Connector block is missing, hardwire things for now. */ 114 /* The DMA Connector block is missing, hardwire things for now. */
115 etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]); 115 etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]);
hw/etraxfs.h
@@ -25,5 +25,4 @@ @@ -25,5 +25,4 @@
25 #include "etraxfs_dma.h" 25 #include "etraxfs_dma.h"
26 26
27 qemu_irq *cris_pic_init_cpu(CPUState *env); 27 qemu_irq *cris_pic_init_cpu(CPUState *env);
28 -void *etraxfs_eth_init(NICInfo *nd, CPUState *env,  
29 - target_phys_addr_t base, int phyaddr); 28 +void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr);
hw/etraxfs_dma.c
@@ -186,8 +186,6 @@ struct fs_dma_channel @@ -186,8 +186,6 @@ struct fs_dma_channel
186 struct fs_dma_ctrl 186 struct fs_dma_ctrl
187 { 187 {
188 int map; 188 int map;
189 - CPUState *env;  
190 -  
191 int nr_channels; 189 int nr_channels;
192 struct fs_dma_channel *channels; 190 struct fs_dma_channel *channels;
193 191
@@ -741,8 +739,7 @@ static void DMA_run(void *opaque) @@ -741,8 +739,7 @@ static void DMA_run(void *opaque)
741 qemu_bh_schedule_idle(etraxfs_dmac->bh); 739 qemu_bh_schedule_idle(etraxfs_dmac->bh);
742 } 740 }
743 741
744 -void *etraxfs_dmac_init(CPUState *env,  
745 - target_phys_addr_t base, int nr_channels) 742 +void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels)
746 { 743 {
747 struct fs_dma_ctrl *ctrl = NULL; 744 struct fs_dma_ctrl *ctrl = NULL;
748 745
@@ -750,7 +747,6 @@ void *etraxfs_dmac_init(CPUState *env, @@ -750,7 +747,6 @@ void *etraxfs_dmac_init(CPUState *env,
750 747
751 ctrl->bh = qemu_bh_new(DMA_run, ctrl); 748 ctrl->bh = qemu_bh_new(DMA_run, ctrl);
752 749
753 - ctrl->env = env;  
754 ctrl->nr_channels = nr_channels; 750 ctrl->nr_channels = nr_channels;
755 ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels); 751 ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);
756 752
hw/etraxfs_dma.h
@@ -13,8 +13,7 @@ struct etraxfs_dma_client @@ -13,8 +13,7 @@ struct etraxfs_dma_client
13 } client; 13 } client;
14 }; 14 };
15 15
16 -void *etraxfs_dmac_init(CPUState *env, target_phys_addr_t base,  
17 - int nr_channels); 16 +void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels);
18 void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, 17 void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line,
19 int input); 18 int input);
20 void etraxfs_dmac_connect_client(void *opaque, int c, 19 void etraxfs_dmac_connect_client(void *opaque, int c,
hw/etraxfs_eth.c
@@ -319,7 +319,6 @@ static void mdio_cycle(struct qemu_mdio *bus) @@ -319,7 +319,6 @@ static void mdio_cycle(struct qemu_mdio *bus)
319 319
320 struct fs_eth 320 struct fs_eth
321 { 321 {
322 - CPUState *env;  
323 VLANClientState *vc; 322 VLANClientState *vc;
324 int ethregs; 323 int ethregs;
325 324
@@ -565,8 +564,7 @@ static void eth_cleanup(VLANClientState *vc) @@ -565,8 +564,7 @@ static void eth_cleanup(VLANClientState *vc)
565 qemu_free(eth); 564 qemu_free(eth);
566 } 565 }
567 566
568 -void *etraxfs_eth_init(NICInfo *nd, CPUState *env,  
569 - target_phys_addr_t base, int phyaddr) 567 +void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
570 { 568 {
571 struct etraxfs_dma_client *dma = NULL; 569 struct etraxfs_dma_client *dma = NULL;
572 struct fs_eth *eth = NULL; 570 struct fs_eth *eth = NULL;
@@ -574,7 +572,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, @@ -574,7 +572,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env,
574 qemu_check_nic_model(nd, "fseth"); 572 qemu_check_nic_model(nd, "fseth");
575 573
576 dma = qemu_mallocz(sizeof *dma * 2); 574 dma = qemu_mallocz(sizeof *dma * 2);
577 -  
578 eth = qemu_mallocz(sizeof *eth); 575 eth = qemu_mallocz(sizeof *eth);
579 576
580 dma[0].client.push = eth_tx_push; 577 dma[0].client.push = eth_tx_push;
@@ -582,7 +579,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, @@ -582,7 +579,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env,
582 dma[1].client.opaque = eth; 579 dma[1].client.opaque = eth;
583 dma[1].client.pull = NULL; 580 dma[1].client.pull = NULL;
584 581
585 - eth->env = env;  
586 eth->dma_out = dma; 582 eth->dma_out = dma;
587 eth->dma_in = dma + 1; 583 eth->dma_in = dma + 1;
588 584