* ld-srec/sr3.cc (__get_eh_context): New function.
[deliverable/binutils-gdb.git] / sim / txvu / dma.c
CommitLineData
1e1e3b61
IC
1/* Copyright (C) 1998, Cygnus Solutions
2
3 */
4
5#include "sim-main.h"
6
7#include "device.h"
8#include "dma.h"
9
10int
11dma_io_read_buffer(device *me,
12 void *dest,
13 int space,
14 address_word addr,
15 unsigned nr_bytes,
16 sim_cpu *processor,
17 sim_cia cia)
18{
19 printf("%s: Read!\n", me->name);
20 return nr_bytes;
21}
22
23static sim_event_handler do_the_dma_thing_handler;
24
25int
26dma_io_write_buffer(device *me,
27 const void *source,
28 int space,
29 address_word addr,
30 unsigned nr_bytes,
31 sim_cpu *processor,
32 sim_cia cia)
33{
34 printf("%s: Write!\n", me->name);
35
36 /* Do an event before the next instruction! */
37 sim_events_schedule (CPU_STATE(processor),
38 0 /*time*/,
39 do_the_dma_thing_handler,
40 CPU_STATE(processor) /*data*/);
41 return nr_bytes;
42}
43
44device dma_device =
45 {
46 "Dma Controller",
47 &dma_io_read_buffer,
48 &dma_io_write_buffer
49 };
50
51void
52dma_attach(SIM_DESC sd)
53{
54 sim_core_attach (sd,
55 NULL,
56 0 /*level*/,
57 access_read_write,
58 0 /*space ???*/,
59 DMA_REGISTER_WINDOW_START,
60 DMA_REGISTER_WINDOW_SIZE /*nr_bytes*/,
61 0 /*modulo*/,
62 &dma_device,
63 NULL /*buffer*/);
64}
65
66static void
67do_the_dma_thing_handler(SIM_DESC sd, void *data)
68{
69 printf("Dma Event!!!\n");
70}
This page took 0.055014 seconds and 4 git commands to generate.