Commit ba494313d386475e849b536fe0eb1cd05d8dfa68
1 parent
e510e05b
etrax: Don't pass CPUState to peripherals.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Showing
6 changed files
with
10 additions
and
20 deletions
hw/axis_dev88.c
| ... | ... | @@ -309,16 +309,16 @@ void axisdev88_init (ram_addr_t ram_size, |
| 309 | 309 | nmi[0] = qdev_get_gpio_in(dev, 30); |
| 310 | 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 | 313 | for (i = 0; i < 10; i++) { |
| 314 | 314 | /* On ETRAX, odd numbered channels are inputs. */ |
| 315 | 315 | etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 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 | 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 | 323 | /* The DMA Connector block is missing, hardwire things for now. */ |
| 324 | 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 | 100 | nmi[0] = qdev_get_gpio_in(dev, 30); |
| 101 | 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 | 104 | for (i = 0; i < 10; i++) { |
| 105 | 105 | /* On ETRAX, odd numbered channels are inputs. */ |
| 106 | 106 | etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 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 | 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 | 114 | /* The DMA Connector block is missing, hardwire things for now. */ |
| 115 | 115 | etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]); | ... | ... |
hw/etraxfs.h
hw/etraxfs_dma.c
| ... | ... | @@ -186,8 +186,6 @@ struct fs_dma_channel |
| 186 | 186 | struct fs_dma_ctrl |
| 187 | 187 | { |
| 188 | 188 | int map; |
| 189 | - CPUState *env; | |
| 190 | - | |
| 191 | 189 | int nr_channels; |
| 192 | 190 | struct fs_dma_channel *channels; |
| 193 | 191 | |
| ... | ... | @@ -741,8 +739,7 @@ static void DMA_run(void *opaque) |
| 741 | 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 | 744 | struct fs_dma_ctrl *ctrl = NULL; |
| 748 | 745 | |
| ... | ... | @@ -750,7 +747,6 @@ void *etraxfs_dmac_init(CPUState *env, |
| 750 | 747 | |
| 751 | 748 | ctrl->bh = qemu_bh_new(DMA_run, ctrl); |
| 752 | 749 | |
| 753 | - ctrl->env = env; | |
| 754 | 750 | ctrl->nr_channels = nr_channels; |
| 755 | 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 | 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 | 17 | void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, |
| 19 | 18 | int input); |
| 20 | 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 | 319 | |
| 320 | 320 | struct fs_eth |
| 321 | 321 | { |
| 322 | - CPUState *env; | |
| 323 | 322 | VLANClientState *vc; |
| 324 | 323 | int ethregs; |
| 325 | 324 | |
| ... | ... | @@ -565,8 +564,7 @@ static void eth_cleanup(VLANClientState *vc) |
| 565 | 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 | 569 | struct etraxfs_dma_client *dma = NULL; |
| 572 | 570 | struct fs_eth *eth = NULL; |
| ... | ... | @@ -574,7 +572,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, |
| 574 | 572 | qemu_check_nic_model(nd, "fseth"); |
| 575 | 573 | |
| 576 | 574 | dma = qemu_mallocz(sizeof *dma * 2); |
| 577 | - | |
| 578 | 575 | eth = qemu_mallocz(sizeof *eth); |
| 579 | 576 | |
| 580 | 577 | dma[0].client.push = eth_tx_push; |
| ... | ... | @@ -582,7 +579,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, |
| 582 | 579 | dma[1].client.opaque = eth; |
| 583 | 580 | dma[1].client.pull = NULL; |
| 584 | 581 | |
| 585 | - eth->env = env; | |
| 586 | 582 | eth->dma_out = dma; |
| 587 | 583 | eth->dma_in = dma + 1; |
| 588 | 584 | ... | ... |