Revision ba494313

b/hw/axis_dev88.c
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]);
b/hw/etraxfs.c
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]);
b/hw/etraxfs.h
25 25
#include "etraxfs_dma.h"
26 26

  
27 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);
b/hw/etraxfs_dma.c
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 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 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

  
b/hw/etraxfs_dma.h
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, 
b/hw/etraxfs_eth.c
319 319

  
320 320
struct fs_eth
321 321
{
322
	CPUState *env;
323 322
	VLANClientState *vc;
324 323
	int ethregs;
325 324

  
......
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 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 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

  

Also available in: Unified diff