root / hw / mac_dbdma.c @ 1ffc346f
History | View | Annotate | Download (2.3 kB)
1 | 3cbee15b | j_mayer | /*
|
---|---|---|---|
2 | 3cbee15b | j_mayer | * PowerMac descriptor-based DMA emulation
|
3 | 3cbee15b | j_mayer | *
|
4 | 3cbee15b | j_mayer | * Copyright (c) 2005-2007 Fabrice Bellard
|
5 | 3cbee15b | j_mayer | * Copyright (c) 2007 Jocelyn Mayer
|
6 | 3cbee15b | j_mayer | *
|
7 | 3cbee15b | j_mayer | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 | 3cbee15b | j_mayer | * of this software and associated documentation files (the "Software"), to deal
|
9 | 3cbee15b | j_mayer | * in the Software without restriction, including without limitation the rights
|
10 | 3cbee15b | j_mayer | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11 | 3cbee15b | j_mayer | * copies of the Software, and to permit persons to whom the Software is
|
12 | 3cbee15b | j_mayer | * furnished to do so, subject to the following conditions:
|
13 | 3cbee15b | j_mayer | *
|
14 | 3cbee15b | j_mayer | * The above copyright notice and this permission notice shall be included in
|
15 | 3cbee15b | j_mayer | * all copies or substantial portions of the Software.
|
16 | 3cbee15b | j_mayer | *
|
17 | 3cbee15b | j_mayer | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18 | 3cbee15b | j_mayer | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19 | 3cbee15b | j_mayer | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
20 | 3cbee15b | j_mayer | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21 | 3cbee15b | j_mayer | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22 | 3cbee15b | j_mayer | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23 | 3cbee15b | j_mayer | * THE SOFTWARE.
|
24 | 3cbee15b | j_mayer | */
|
25 | 87ecb68b | pbrook | #include "hw.h" |
26 | 3cbee15b | j_mayer | #include "ppc_mac.h" |
27 | 3cbee15b | j_mayer | |
28 | 3cbee15b | j_mayer | /* DBDMA: currently no op - should suffice right now */
|
29 | 3cbee15b | j_mayer | |
30 | 3cbee15b | j_mayer | static void dbdma_writeb (void *opaque, |
31 | 3cbee15b | j_mayer | target_phys_addr_t addr, uint32_t value) |
32 | 3cbee15b | j_mayer | { |
33 | 3cbee15b | j_mayer | printf("%s: 0x" PADDRX " <= 0x%08x\n", __func__, addr, value); |
34 | 3cbee15b | j_mayer | } |
35 | 3cbee15b | j_mayer | |
36 | 3cbee15b | j_mayer | static void dbdma_writew (void *opaque, |
37 | 3cbee15b | j_mayer | target_phys_addr_t addr, uint32_t value) |
38 | 3cbee15b | j_mayer | { |
39 | 3cbee15b | j_mayer | } |
40 | 3cbee15b | j_mayer | |
41 | 3cbee15b | j_mayer | static void dbdma_writel (void *opaque, |
42 | 3cbee15b | j_mayer | target_phys_addr_t addr, uint32_t value) |
43 | 3cbee15b | j_mayer | { |
44 | 3cbee15b | j_mayer | } |
45 | 3cbee15b | j_mayer | |
46 | 3cbee15b | j_mayer | static uint32_t dbdma_readb (void *opaque, target_phys_addr_t addr) |
47 | 3cbee15b | j_mayer | { |
48 | 3cbee15b | j_mayer | printf("%s: 0x" PADDRX " => 0x00000000\n", __func__, addr); |
49 | 3cbee15b | j_mayer | |
50 | 3cbee15b | j_mayer | return 0; |
51 | 3cbee15b | j_mayer | } |
52 | 3cbee15b | j_mayer | |
53 | 3cbee15b | j_mayer | static uint32_t dbdma_readw (void *opaque, target_phys_addr_t addr) |
54 | 3cbee15b | j_mayer | { |
55 | 3cbee15b | j_mayer | return 0; |
56 | 3cbee15b | j_mayer | } |
57 | 3cbee15b | j_mayer | |
58 | 3cbee15b | j_mayer | static uint32_t dbdma_readl (void *opaque, target_phys_addr_t addr) |
59 | 3cbee15b | j_mayer | { |
60 | 3cbee15b | j_mayer | return 0; |
61 | 3cbee15b | j_mayer | } |
62 | 3cbee15b | j_mayer | |
63 | 3cbee15b | j_mayer | static CPUWriteMemoryFunc *dbdma_write[] = {
|
64 | 3cbee15b | j_mayer | &dbdma_writeb, |
65 | 3cbee15b | j_mayer | &dbdma_writew, |
66 | 3cbee15b | j_mayer | &dbdma_writel, |
67 | 3cbee15b | j_mayer | }; |
68 | 3cbee15b | j_mayer | |
69 | 3cbee15b | j_mayer | static CPUReadMemoryFunc *dbdma_read[] = {
|
70 | 3cbee15b | j_mayer | &dbdma_readb, |
71 | 3cbee15b | j_mayer | &dbdma_readw, |
72 | 3cbee15b | j_mayer | &dbdma_readl, |
73 | 3cbee15b | j_mayer | }; |
74 | 3cbee15b | j_mayer | |
75 | 3cbee15b | j_mayer | void dbdma_init (int *dbdma_mem_index) |
76 | 3cbee15b | j_mayer | { |
77 | 3cbee15b | j_mayer | *dbdma_mem_index = cpu_register_io_memory(0, dbdma_read, dbdma_write, NULL); |
78 | 3cbee15b | j_mayer | } |