aboutsummaryrefslogtreecommitdiff
path: root/hw/mips_mipssim.c
diff options
context:
space:
mode:
authorHervé Poussineau <hpoussin@reactos.org>2011-09-04 22:29:26 +0200
committerBlue Swirl <blauwirbel@gmail.com>2011-09-10 16:50:46 +0000
commitd118d64a929173f7ee7340265c4cd37bcf34667e (patch)
tree8558da4aaa6d1d3e546fc03040a5b23055dfc61e /hw/mips_mipssim.c
parentf64e02b6cc17d6c9c096ec2c89af75dc8e56666b (diff)
mipsnet: convert to qdev
Move mipsnet_init() function to mipssim machine Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/mips_mipssim.c')
-rw-r--r--hw/mips_mipssim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index 0d46cc4c5a..ac65555b74 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -35,6 +35,8 @@
#include "mips-bios.h"
#include "loader.h"
#include "elf.h"
+#include "sysbus.h"
+#include "exec-memory.h"
static struct _loaderparams {
int ram_size;
@@ -112,6 +114,22 @@ static void main_cpu_reset(void *opaque)
}
}
+static void mipsnet_init(int base, qemu_irq irq, NICInfo *nd)
+{
+ DeviceState *dev;
+ SysBusDevice *s;
+
+ dev = qdev_create(NULL, "mipsnet");
+ qdev_set_nic_properties(dev, nd);
+ qdev_init_nofail(dev);
+
+ s = sysbus_from_qdev(dev);
+ sysbus_connect_irq(s, 0, irq);
+ memory_region_add_subregion(get_system_io(),
+ base,
+ sysbus_mmio_get_region(s, 0));
+}
+
static void
mips_mipssim_init (ram_addr_t ram_size,
const char *boot_device,