From ba494313d386475e849b536fe0eb1cd05d8dfa68 Mon Sep 17 00:00:00 2001 From: "Edgar E. Iglesias" Date: Mon, 15 Jun 2009 21:00:50 +0200 Subject: [PATCH] etrax: Don't pass CPUState to peripherals. Signed-off-by: Edgar E. Iglesias --- hw/axis_dev88.c | 6 +++--- hw/etraxfs.c | 6 +++--- hw/etraxfs.h | 3 +-- hw/etraxfs_dma.c | 6 +----- hw/etraxfs_dma.h | 3 +-- hw/etraxfs_eth.c | 6 +----- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c index fc527cbecb..c4e09dd5ee 100644 --- a/hw/axis_dev88.c +++ b/hw/axis_dev88.c @@ -309,16 +309,16 @@ void axisdev88_init (ram_addr_t ram_size, nmi[0] = qdev_get_gpio_in(dev, 30); nmi[1] = qdev_get_gpio_in(dev, 31); - etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10); + etraxfs_dmac = etraxfs_dmac_init(0x30000000, 10); for (i = 0; i < 10; i++) { /* On ETRAX, odd numbered channels are inputs. */ etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); } /* Add the two ethernet blocks. */ - eth[0] = etraxfs_eth_init(&nd_table[0], env, 0x30034000, 1); + eth[0] = etraxfs_eth_init(&nd_table[0], 0x30034000, 1); if (nb_nics > 1) - eth[1] = etraxfs_eth_init(&nd_table[1], env, 0x30036000, 2); + eth[1] = etraxfs_eth_init(&nd_table[1], 0x30036000, 2); /* The DMA Connector block is missing, hardwire things for now. */ etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]); diff --git a/hw/etraxfs.c b/hw/etraxfs.c index 419aca1dab..362d286f52 100644 --- a/hw/etraxfs.c +++ b/hw/etraxfs.c @@ -100,16 +100,16 @@ void bareetraxfs_init (ram_addr_t ram_size, nmi[0] = qdev_get_gpio_in(dev, 30); nmi[1] = qdev_get_gpio_in(dev, 31); - etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10); + etraxfs_dmac = etraxfs_dmac_init(0x30000000, 10); for (i = 0; i < 10; i++) { /* On ETRAX, odd numbered channels are inputs. */ etraxfs_dmac_connect(etraxfs_dmac, i, irq + 7 + i, i & 1); } /* Add the two ethernet blocks. */ - eth[0] = etraxfs_eth_init(&nd_table[0], env, 0x30034000, 1); + eth[0] = etraxfs_eth_init(&nd_table[0], 0x30034000, 1); if (nb_nics > 1) - eth[1] = etraxfs_eth_init(&nd_table[1], env, 0x30036000, 2); + eth[1] = etraxfs_eth_init(&nd_table[1], 0x30036000, 2); /* The DMA Connector block is missing, hardwire things for now. */ etraxfs_dmac_connect_client(etraxfs_dmac, 0, eth[0]); diff --git a/hw/etraxfs.h b/hw/etraxfs.h index 9cc30bee46..01fb9d3e82 100644 --- a/hw/etraxfs.h +++ b/hw/etraxfs.h @@ -25,5 +25,4 @@ #include "etraxfs_dma.h" qemu_irq *cris_pic_init_cpu(CPUState *env); -void *etraxfs_eth_init(NICInfo *nd, CPUState *env, - target_phys_addr_t base, int phyaddr); +void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr); diff --git a/hw/etraxfs_dma.c b/hw/etraxfs_dma.c index d465aff1cd..1b65d03459 100644 --- a/hw/etraxfs_dma.c +++ b/hw/etraxfs_dma.c @@ -186,8 +186,6 @@ struct fs_dma_channel struct fs_dma_ctrl { int map; - CPUState *env; - int nr_channels; struct fs_dma_channel *channels; @@ -741,8 +739,7 @@ static void DMA_run(void *opaque) qemu_bh_schedule_idle(etraxfs_dmac->bh); } -void *etraxfs_dmac_init(CPUState *env, - target_phys_addr_t base, int nr_channels) +void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels) { struct fs_dma_ctrl *ctrl = NULL; @@ -750,7 +747,6 @@ void *etraxfs_dmac_init(CPUState *env, ctrl->bh = qemu_bh_new(DMA_run, ctrl); - ctrl->env = env; ctrl->nr_channels = nr_channels; ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels); diff --git a/hw/etraxfs_dma.h b/hw/etraxfs_dma.h index c29dab9763..96408abab3 100644 --- a/hw/etraxfs_dma.h +++ b/hw/etraxfs_dma.h @@ -13,8 +13,7 @@ struct etraxfs_dma_client } client; }; -void *etraxfs_dmac_init(CPUState *env, target_phys_addr_t base, - int nr_channels); +void *etraxfs_dmac_init(target_phys_addr_t base, int nr_channels); void etraxfs_dmac_connect(void *opaque, int channel, qemu_irq *line, int input); void etraxfs_dmac_connect_client(void *opaque, int c, diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c index c7df44ee45..469be55a40 100644 --- a/hw/etraxfs_eth.c +++ b/hw/etraxfs_eth.c @@ -319,7 +319,6 @@ static void mdio_cycle(struct qemu_mdio *bus) struct fs_eth { - CPUState *env; VLANClientState *vc; int ethregs; @@ -565,8 +564,7 @@ static void eth_cleanup(VLANClientState *vc) qemu_free(eth); } -void *etraxfs_eth_init(NICInfo *nd, CPUState *env, - target_phys_addr_t base, int phyaddr) +void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr) { struct etraxfs_dma_client *dma = NULL; struct fs_eth *eth = NULL; @@ -574,7 +572,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, qemu_check_nic_model(nd, "fseth"); dma = qemu_mallocz(sizeof *dma * 2); - eth = qemu_mallocz(sizeof *eth); dma[0].client.push = eth_tx_push; @@ -582,7 +579,6 @@ void *etraxfs_eth_init(NICInfo *nd, CPUState *env, dma[1].client.opaque = eth; dma[1].client.pull = NULL; - eth->env = env; eth->dma_out = dma; eth->dma_in = dma + 1; -- 2.11.4.GIT