aboutsummaryrefslogtreecommitdiff
path: root/sim/txvu/dma.c
diff options
context:
space:
mode:
authorIan Carmichael <iancarm@cygnus>1998-01-16 19:27:02 +0000
committerIan Carmichael <iancarm@cygnus>1998-01-16 19:27:02 +0000
commit1e1e3b618f80c51d59a6ebeefe282bb920d4a0e8 (patch)
tree5a6580db4e0a13dbaf7917655c3e1734690f3c9c /sim/txvu/dma.c
parent8e12359329fd48edc455afa2f80922eca7b79a7d (diff)
downloadgdb-1e1e3b618f80c51d59a6ebeefe282bb920d4a0e8.zip
gdb-1e1e3b618f80c51d59a6ebeefe282bb920d4a0e8.tar.gz
gdb-1e1e3b618f80c51d59a6ebeefe282bb920d4a0e8.tar.bz2
* Initial Device Support
* *Modified Files: * .Sanitize ChangeLog *Added Files: * Makefile.in README.Cygnus config.in configure configure.in * device.c device.h dma.c dma.h engine-sky.c gencode.c gpuif.c * gpuif.h hardware.c hardware.h interp.c m16.igen mdmx.igen * mips.dc mips.igen pke0.c pke0.h pke1.c pke1.h r5900.igen * sim-main.h tconfig.in vr5400.igen vu0.c vu0.h vu1.c vu1.h
Diffstat (limited to 'sim/txvu/dma.c')
-rw-r--r--sim/txvu/dma.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/sim/txvu/dma.c b/sim/txvu/dma.c
new file mode 100644
index 0000000..7f178aa
--- /dev/null
+++ b/sim/txvu/dma.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1998, Cygnus Solutions
+
+ */
+
+#include "sim-main.h"
+
+#include "device.h"
+#include "dma.h"
+
+int
+dma_io_read_buffer(device *me,
+ void *dest,
+ int space,
+ address_word addr,
+ unsigned nr_bytes,
+ sim_cpu *processor,
+ sim_cia cia)
+{
+ printf("%s: Read!\n", me->name);
+ return nr_bytes;
+}
+
+static sim_event_handler do_the_dma_thing_handler;
+
+int
+dma_io_write_buffer(device *me,
+ const void *source,
+ int space,
+ address_word addr,
+ unsigned nr_bytes,
+ sim_cpu *processor,
+ sim_cia cia)
+{
+ printf("%s: Write!\n", me->name);
+
+ /* Do an event before the next instruction! */
+ sim_events_schedule (CPU_STATE(processor),
+ 0 /*time*/,
+ do_the_dma_thing_handler,
+ CPU_STATE(processor) /*data*/);
+ return nr_bytes;
+}
+
+device dma_device =
+ {
+ "Dma Controller",
+ &dma_io_read_buffer,
+ &dma_io_write_buffer
+ };
+
+void
+dma_attach(SIM_DESC sd)
+{
+ sim_core_attach (sd,
+ NULL,
+ 0 /*level*/,
+ access_read_write,
+ 0 /*space ???*/,
+ DMA_REGISTER_WINDOW_START,
+ DMA_REGISTER_WINDOW_SIZE /*nr_bytes*/,
+ 0 /*modulo*/,
+ &dma_device,
+ NULL /*buffer*/);
+}
+
+static void
+do_the_dma_thing_handler(SIM_DESC sd, void *data)
+{
+ printf("Dma Event!!!\n");
+}