Do not allow AIO to be inited multiple times
[qemu-kvm/fedora.git] / hw / mac_dbdma.c
blob74003e60a620fedb797e11a5965be02a2ac0fa19
1 /*
2 * PowerMac descriptor-based DMA emulation
4 * Copyright (c) 2005-2007 Fabrice Bellard
5 * Copyright (c) 2007 Jocelyn Mayer
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
25 #include "hw.h"
26 #include "ppc_mac.h"
28 /* DBDMA: currently no op - should suffice right now */
30 static void dbdma_writeb (void *opaque,
31 target_phys_addr_t addr, uint32_t value)
33 printf("%s: 0x" PADDRX " <= 0x%08x\n", __func__, addr, value);
36 static void dbdma_writew (void *opaque,
37 target_phys_addr_t addr, uint32_t value)
41 static void dbdma_writel (void *opaque,
42 target_phys_addr_t addr, uint32_t value)
46 static uint32_t dbdma_readb (void *opaque, target_phys_addr_t addr)
48 printf("%s: 0x" PADDRX " => 0x00000000\n", __func__, addr);
50 return 0;
53 static uint32_t dbdma_readw (void *opaque, target_phys_addr_t addr)
55 return 0;
58 static uint32_t dbdma_readl (void *opaque, target_phys_addr_t addr)
60 return 0;
63 static CPUWriteMemoryFunc *dbdma_write[] = {
64 &dbdma_writeb,
65 &dbdma_writew,
66 &dbdma_writel,
69 static CPUReadMemoryFunc *dbdma_read[] = {
70 &dbdma_readb,
71 &dbdma_readw,
72 &dbdma_readl,
75 void dbdma_init (int *dbdma_mem_index)
77 *dbdma_mem_index = cpu_register_io_memory(0, dbdma_read, dbdma_write, NULL);