Revision 9c17d615

b/arch_init.c
30 30
#endif
31 31
#include "config.h"
32 32
#include "monitor/monitor.h"
33
#include "sysemu.h"
33
#include "sysemu/sysemu.h"
34 34
#include "qemu/bitops.h"
35 35
#include "qemu/bitmap.h"
36
#include "arch_init.h"
36
#include "sysemu/arch_init.h"
37 37
#include "audio/audio.h"
38 38
#include "hw/pc.h"
39 39
#include "hw/pci/pci.h"
40 40
#include "hw/audiodev.h"
41
#include "kvm.h"
41
#include "sysemu/kvm.h"
42 42
#include "migration/migration.h"
43 43
#include "exec/gdbstub.h"
44 44
#include "hw/smbios.h"
/dev/null
1
#ifndef QEMU_ARCH_INIT_H
2
#define QEMU_ARCH_INIT_H
3

  
4
#include "qmp-commands.h"
5

  
6
enum {
7
    QEMU_ARCH_ALL = -1,
8
    QEMU_ARCH_ALPHA = 1,
9
    QEMU_ARCH_ARM = 2,
10
    QEMU_ARCH_CRIS = 4,
11
    QEMU_ARCH_I386 = 8,
12
    QEMU_ARCH_M68K = 16,
13
    QEMU_ARCH_LM32 = 32,
14
    QEMU_ARCH_MICROBLAZE = 64,
15
    QEMU_ARCH_MIPS = 128,
16
    QEMU_ARCH_PPC = 256,
17
    QEMU_ARCH_S390X = 512,
18
    QEMU_ARCH_SH4 = 1024,
19
    QEMU_ARCH_SPARC = 2048,
20
    QEMU_ARCH_XTENSA = 4096,
21
    QEMU_ARCH_OPENRISC = 8192,
22
    QEMU_ARCH_UNICORE32 = 0x4000,
23
};
24

  
25
extern const uint32_t arch_type;
26

  
27
void select_soundhw(const char *optarg);
28
void do_acpitable_option(const char *optarg);
29
void do_smbios_option(const char *optarg);
30
void cpudef_init(void);
31
int audio_available(void);
32
void audio_init(ISABus *isa_bus, PCIBus *pci_bus);
33
int tcg_available(void);
34
int kvm_available(void);
35
int xen_available(void);
36

  
37
CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);
38

  
39
#endif
b/audio/audio.c
25 25
#include "audio.h"
26 26
#include "monitor/monitor.h"
27 27
#include "qemu/timer.h"
28
#include "sysemu.h"
28
#include "sysemu/sysemu.h"
29 29

  
30 30
#define AUDIO_CAP "audio"
31 31
#include "audio_int.h"
b/audio/winwaveaudio.c
1 1
/* public domain */
2 2

  
3 3
#include "qemu-common.h"
4
#include "sysemu.h"
4
#include "sysemu/sysemu.h"
5 5
#include "audio.h"
6 6

  
7 7
#define AUDIO_CAP "winwave"
b/balloon.c
26 26

  
27 27
#include "monitor/monitor.h"
28 28
#include "exec/cpu-common.h"
29
#include "kvm.h"
30
#include "balloon.h"
29
#include "sysemu/kvm.h"
30
#include "sysemu/balloon.h"
31 31
#include "trace.h"
32 32
#include "qmp-commands.h"
33 33
#include "qapi/qmp/qjson.h"
/dev/null
1
/*
2
 * Balloon
3
 *
4
 * Copyright IBM, Corp. 2008
5
 *
6
 * Authors:
7
 *  Anthony Liguori   <aliguori@us.ibm.com>
8
 *
9
 * This work is licensed under the terms of the GNU GPL, version 2.  See
10
 * the COPYING file in the top-level directory.
11
 *
12
 */
13

  
14
#ifndef _QEMU_BALLOON_H
15
#define _QEMU_BALLOON_H
16

  
17
#include "monitor/monitor.h"
18
#include "qapi-types.h"
19

  
20
typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target);
21
typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info);
22

  
23
int qemu_add_balloon_handler(QEMUBalloonEvent *event_func,
24
			     QEMUBalloonStatus *stat_func, void *opaque);
25
void qemu_remove_balloon_handler(void *opaque);
26

  
27
void qemu_balloon_changed(int64_t actual);
28

  
29
#endif
b/block-migration.c
20 20
#include "qemu/timer.h"
21 21
#include "migration/block.h"
22 22
#include "migration/migration.h"
23
#include "blockdev.h"
23
#include "sysemu/blockdev.h"
24 24
#include <assert.h>
25 25

  
26 26
#define BLOCK_SIZE (BDRV_SECTORS_PER_DIRTY_CHUNK << BDRV_SECTOR_BITS)
b/block.c
29 29
#include "block/blockjob.h"
30 30
#include "qemu/module.h"
31 31
#include "qapi/qmp/qjson.h"
32
#include "sysemu.h"
32
#include "sysemu/sysemu.h"
33 33
#include "qemu/notify.h"
34 34
#include "block/coroutine.h"
35 35
#include "qmp-commands.h"
b/block/vdi.c
58 58
#include <uuid/uuid.h>
59 59
#else
60 60
/* TODO: move uuid emulation to some central place in QEMU. */
61
#include "sysemu.h"     /* UUID_FMT */
61
#include "sysemu/sysemu.h"     /* UUID_FMT */
62 62
typedef unsigned char uuid_t[16];
63 63
#endif
64 64

  
b/blockdev-nbd.c
9 9
 * later.  See the COPYING file in the top-level directory.
10 10
 */
11 11

  
12
#include "blockdev.h"
12
#include "sysemu/blockdev.h"
13 13
#include "hw/block-common.h"
14 14
#include "monitor/monitor.h"
15 15
#include "qapi/qmp/qerror.h"
16
#include "sysemu.h"
16
#include "sysemu/sysemu.h"
17 17
#include "qmp-commands.h"
18 18
#include "trace.h"
19 19
#include "block/nbd.h"
b/blockdev.c
7 7
 * later.  See the COPYING file in the top-level directory.
8 8
 */
9 9

  
10
#include "blockdev.h"
10
#include "sysemu/blockdev.h"
11 11
#include "hw/block-common.h"
12 12
#include "block/blockjob.h"
13 13
#include "monitor/monitor.h"
......
15 15
#include "qemu/option.h"
16 16
#include "qemu/config-file.h"
17 17
#include "qapi/qmp/types.h"
18
#include "sysemu.h"
18
#include "sysemu/sysemu.h"
19 19
#include "block/block_int.h"
20 20
#include "qmp-commands.h"
21 21
#include "trace.h"
22
#include "arch_init.h"
22
#include "sysemu/arch_init.h"
23 23

  
24 24
static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives);
25 25

  
/dev/null
1
/*
2
 * QEMU host block devices
3
 *
4
 * Copyright (c) 2003-2008 Fabrice Bellard
5
 *
6
 * This work is licensed under the terms of the GNU GPL, version 2 or
7
 * later.  See the COPYING file in the top-level directory.
8
 */
9

  
10
#ifndef BLOCKDEV_H
11
#define BLOCKDEV_H
12

  
13
#include "block/block.h"
14
#include "qapi/error.h"
15
#include "qemu/queue.h"
16

  
17
void blockdev_mark_auto_del(BlockDriverState *bs);
18
void blockdev_auto_del(BlockDriverState *bs);
19

  
20
typedef enum {
21
    IF_DEFAULT = -1,            /* for use with drive_add() only */
22
    /*
23
     * IF_IDE must be zero, because we want QEMUMachine member
24
     * block_default_type to default-initialize to IF_IDE
25
     */
26
    IF_IDE = 0,
27
    IF_NONE,
28
    IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN,
29
    IF_COUNT
30
} BlockInterfaceType;
31

  
32
struct DriveInfo {
33
    BlockDriverState *bdrv;
34
    char *id;
35
    const char *devaddr;
36
    BlockInterfaceType type;
37
    int bus;
38
    int unit;
39
    int auto_del;               /* see blockdev_mark_auto_del() */
40
    int media_cd;
41
    int cyls, heads, secs, trans;
42
    QemuOpts *opts;
43
    const char *serial;
44
    QTAILQ_ENTRY(DriveInfo) next;
45
    int refcount;
46
};
47

  
48
DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
49
DriveInfo *drive_get_by_index(BlockInterfaceType type, int index);
50
int drive_get_max_bus(BlockInterfaceType type);
51
DriveInfo *drive_get_next(BlockInterfaceType type);
52
void drive_get_ref(DriveInfo *dinfo);
53
void drive_put_ref(DriveInfo *dinfo);
54
DriveInfo *drive_get_by_blockdev(BlockDriverState *bs);
55

  
56
QemuOpts *drive_def(const char *optstr);
57
QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file,
58
                    const char *optstr);
59
DriveInfo *drive_init(QemuOpts *arg, BlockInterfaceType block_default_type);
60

  
61
/* device-hotplug */
62

  
63
DriveInfo *add_init_drive(const char *opts);
64

  
65
void qmp_change_blockdev(const char *device, const char *filename,
66
                         bool has_format, const char *format, Error **errp);
67
void do_commit(Monitor *mon, const QDict *qdict);
68
int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
69
#endif
b/cpu-exec.c
21 21
#include "disas/disas.h"
22 22
#include "tcg.h"
23 23
#include "qemu/atomic.h"
24
#include "qtest.h"
24
#include "sysemu/qtest.h"
25 25

  
26 26
int tb_invalidated_flag;
27 27

  
b/cpus.c
26 26
#include "config-host.h"
27 27

  
28 28
#include "monitor/monitor.h"
29
#include "sysemu.h"
29
#include "sysemu/sysemu.h"
30 30
#include "exec/gdbstub.h"
31
#include "dma.h"
32
#include "kvm.h"
31
#include "sysemu/dma.h"
32
#include "sysemu/kvm.h"
33 33
#include "qmp-commands.h"
34 34

  
35 35
#include "qemu/thread.h"
36
#include "cpus.h"
37
#include "qtest.h"
36
#include "sysemu/cpus.h"
37
#include "sysemu/qtest.h"
38 38
#include "qemu/main-loop.h"
39 39
#include "qemu/bitmap.h"
40 40

  
/dev/null
1
#ifndef QEMU_CPUS_H
2
#define QEMU_CPUS_H
3

  
4
/* cpus.c */
5
void qemu_init_cpu_loop(void);
6
void resume_all_vcpus(void);
7
void pause_all_vcpus(void);
8
void cpu_stop_current(void);
9

  
10
void cpu_synchronize_all_states(void);
11
void cpu_synchronize_all_post_reset(void);
12
void cpu_synchronize_all_post_init(void);
13

  
14
void qtest_clock_warp(int64_t dest);
15

  
16
/* vl.c */
17
extern int smp_cores;
18
extern int smp_threads;
19
void set_numa_modes(void);
20
void set_cpu_log(const char *optarg);
21
void set_cpu_log_filename(const char *optarg);
22
void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg);
23

  
24
#endif
b/device_tree.c
20 20

  
21 21
#include "config.h"
22 22
#include "qemu-common.h"
23
#include "device_tree.h"
23
#include "sysemu/device_tree.h"
24 24
#include "hw/loader.h"
25 25
#include "qemu/option.h"
26 26
#include "qemu/config-file.h"
/dev/null
1
/*
2
 * Header with function prototypes to help device tree manipulation using
3
 * libfdt. It also provides functions to read entries from device tree proc
4
 * interface.
5
 *
6
 * Copyright 2008 IBM Corporation.
7
 * Authors: Jerone Young <jyoung5@us.ibm.com>
8
 *          Hollis Blanchard <hollisb@us.ibm.com>
9
 *
10
 * This work is licensed under the GNU GPL license version 2 or later.
11
 *
12
 */
13

  
14
#ifndef __DEVICE_TREE_H__
15
#define __DEVICE_TREE_H__
16

  
17
void *create_device_tree(int *sizep);
18
void *load_device_tree(const char *filename_path, int *sizep);
19

  
20
int qemu_devtree_setprop(void *fdt, const char *node_path,
21
                         const char *property, const void *val_array, int size);
22
int qemu_devtree_setprop_cell(void *fdt, const char *node_path,
23
                              const char *property, uint32_t val);
24
int qemu_devtree_setprop_u64(void *fdt, const char *node_path,
25
                             const char *property, uint64_t val);
26
int qemu_devtree_setprop_string(void *fdt, const char *node_path,
27
                                const char *property, const char *string);
28
int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
29
                                 const char *property,
30
                                 const char *target_node_path);
31
const void *qemu_devtree_getprop(void *fdt, const char *node_path,
32
                                 const char *property, int *lenp);
33
uint32_t qemu_devtree_getprop_cell(void *fdt, const char *node_path,
34
                                   const char *property);
35
uint32_t qemu_devtree_get_phandle(void *fdt, const char *path);
36
uint32_t qemu_devtree_alloc_phandle(void *fdt);
37
int qemu_devtree_nop_node(void *fdt, const char *node_path);
38
int qemu_devtree_add_subnode(void *fdt, const char *name);
39

  
40
#define qemu_devtree_setprop_cells(fdt, node_path, property, ...)             \
41
    do {                                                                      \
42
        uint32_t qdt_tmp[] = { __VA_ARGS__ };                                 \
43
        int i;                                                                \
44
                                                                              \
45
        for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) {                           \
46
            qdt_tmp[i] = cpu_to_be32(qdt_tmp[i]);                             \
47
        }                                                                     \
48
        qemu_devtree_setprop(fdt, node_path, property, qdt_tmp,               \
49
                             sizeof(qdt_tmp));                                \
50
    } while (0)
51

  
52
void qemu_devtree_dumpdtb(void *fdt, int size);
53

  
54
#endif /* __DEVICE_TREE_H__ */
b/dma-helpers.c
7 7
 * (GNU GPL), version 2 or later.
8 8
 */
9 9

  
10
#include "dma.h"
10
#include "sysemu/dma.h"
11 11
#include "trace.h"
12 12
#include "qemu/range.h"
13 13
#include "qemu/thread.h"
/dev/null
1
/*
2
 * DMA helper functions
3
 *
4
 * Copyright (c) 2009 Red Hat
5
 *
6
 * This work is licensed under the terms of the GNU General Public License
7
 * (GNU GPL), version 2 or later.
8
 */
9

  
10
#ifndef DMA_H
11
#define DMA_H
12

  
13
#include <stdio.h>
14
#include "exec/memory.h"
15
#include "hw/hw.h"
16
#include "block/block.h"
17
#include "kvm.h"
18

  
19
typedef struct DMAContext DMAContext;
20
typedef struct ScatterGatherEntry ScatterGatherEntry;
21

  
22
typedef enum {
23
    DMA_DIRECTION_TO_DEVICE = 0,
24
    DMA_DIRECTION_FROM_DEVICE = 1,
25
} DMADirection;
26

  
27
struct QEMUSGList {
28
    ScatterGatherEntry *sg;
29
    int nsg;
30
    int nalloc;
31
    size_t size;
32
    DMAContext *dma;
33
};
34

  
35
#ifndef CONFIG_USER_ONLY
36

  
37
/*
38
 * When an IOMMU is present, bus addresses become distinct from
39
 * CPU/memory physical addresses and may be a different size.  Because
40
 * the IOVA size depends more on the bus than on the platform, we more
41
 * or less have to treat these as 64-bit always to cover all (or at
42
 * least most) cases.
43
 */
44
typedef uint64_t dma_addr_t;
45

  
46
#define DMA_ADDR_BITS 64
47
#define DMA_ADDR_FMT "%" PRIx64
48

  
49
typedef int DMATranslateFunc(DMAContext *dma,
50
                             dma_addr_t addr,
51
                             hwaddr *paddr,
52
                             hwaddr *len,
53
                             DMADirection dir);
54
typedef void* DMAMapFunc(DMAContext *dma,
55
                         dma_addr_t addr,
56
                         dma_addr_t *len,
57
                         DMADirection dir);
58
typedef void DMAUnmapFunc(DMAContext *dma,
59
                          void *buffer,
60
                          dma_addr_t len,
61
                          DMADirection dir,
62
                          dma_addr_t access_len);
63

  
64
struct DMAContext {
65
    AddressSpace *as;
66
    DMATranslateFunc *translate;
67
    DMAMapFunc *map;
68
    DMAUnmapFunc *unmap;
69
};
70

  
71
/* A global DMA context corresponding to the address_space_memory
72
 * AddressSpace, for sysbus devices which do DMA.
73
 */
74
extern DMAContext dma_context_memory;
75

  
76
static inline void dma_barrier(DMAContext *dma, DMADirection dir)
77
{
78
    /*
79
     * This is called before DMA read and write operations
80
     * unless the _relaxed form is used and is responsible
81
     * for providing some sane ordering of accesses vs
82
     * concurrently running VCPUs.
83
     *
84
     * Users of map(), unmap() or lower level st/ld_*
85
     * operations are responsible for providing their own
86
     * ordering via barriers.
87
     *
88
     * This primitive implementation does a simple smp_mb()
89
     * before each operation which provides pretty much full
90
     * ordering.
91
     *
92
     * A smarter implementation can be devised if needed to
93
     * use lighter barriers based on the direction of the
94
     * transfer, the DMA context, etc...
95
     */
96
    if (kvm_enabled()) {
97
        smp_mb();
98
    }
99
}
100

  
101
static inline bool dma_has_iommu(DMAContext *dma)
102
{
103
    return dma && dma->translate;
104
}
105

  
106
/* Checks that the given range of addresses is valid for DMA.  This is
107
 * useful for certain cases, but usually you should just use
108
 * dma_memory_{read,write}() and check for errors */
109
bool iommu_dma_memory_valid(DMAContext *dma, dma_addr_t addr, dma_addr_t len,
110
                            DMADirection dir);
111
static inline bool dma_memory_valid(DMAContext *dma,
112
                                    dma_addr_t addr, dma_addr_t len,
113
                                    DMADirection dir)
114
{
115
    if (!dma_has_iommu(dma)) {
116
        return true;
117
    } else {
118
        return iommu_dma_memory_valid(dma, addr, len, dir);
119
    }
120
}
121

  
122
int iommu_dma_memory_rw(DMAContext *dma, dma_addr_t addr,
123
                        void *buf, dma_addr_t len, DMADirection dir);
124
static inline int dma_memory_rw_relaxed(DMAContext *dma, dma_addr_t addr,
125
                                        void *buf, dma_addr_t len,
126
                                        DMADirection dir)
127
{
128
    if (!dma_has_iommu(dma)) {
129
        /* Fast-path for no IOMMU */
130
        address_space_rw(dma->as, addr, buf, len, dir == DMA_DIRECTION_FROM_DEVICE);
131
        return 0;
132
    } else {
133
        return iommu_dma_memory_rw(dma, addr, buf, len, dir);
134
    }
135
}
136

  
137
static inline int dma_memory_read_relaxed(DMAContext *dma, dma_addr_t addr,
138
                                          void *buf, dma_addr_t len)
139
{
140
    return dma_memory_rw_relaxed(dma, addr, buf, len, DMA_DIRECTION_TO_DEVICE);
141
}
142

  
143
static inline int dma_memory_write_relaxed(DMAContext *dma, dma_addr_t addr,
144
                                           const void *buf, dma_addr_t len)
145
{
146
    return dma_memory_rw_relaxed(dma, addr, (void *)buf, len,
147
                                 DMA_DIRECTION_FROM_DEVICE);
148
}
149

  
150
static inline int dma_memory_rw(DMAContext *dma, dma_addr_t addr,
151
                                void *buf, dma_addr_t len,
152
                                DMADirection dir)
153
{
154
    dma_barrier(dma, dir);
155

  
156
    return dma_memory_rw_relaxed(dma, addr, buf, len, dir);
157
}
158

  
159
static inline int dma_memory_read(DMAContext *dma, dma_addr_t addr,
160
                                  void *buf, dma_addr_t len)
161
{
162
    return dma_memory_rw(dma, addr, buf, len, DMA_DIRECTION_TO_DEVICE);
163
}
164

  
165
static inline int dma_memory_write(DMAContext *dma, dma_addr_t addr,
166
                                   const void *buf, dma_addr_t len)
167
{
168
    return dma_memory_rw(dma, addr, (void *)buf, len,
169
                         DMA_DIRECTION_FROM_DEVICE);
170
}
171

  
172
int iommu_dma_memory_set(DMAContext *dma, dma_addr_t addr, uint8_t c,
173
			 dma_addr_t len);
174

  
175
int dma_memory_set(DMAContext *dma, dma_addr_t addr, uint8_t c, dma_addr_t len);
176

  
177
void *iommu_dma_memory_map(DMAContext *dma,
178
                           dma_addr_t addr, dma_addr_t *len,
179
                           DMADirection dir);
180
static inline void *dma_memory_map(DMAContext *dma,
181
                                   dma_addr_t addr, dma_addr_t *len,
182
                                   DMADirection dir)
183
{
184
    if (!dma_has_iommu(dma)) {
185
        hwaddr xlen = *len;
186
        void *p;
187

  
188
        p = address_space_map(dma->as, addr, &xlen, dir == DMA_DIRECTION_FROM_DEVICE);
189
        *len = xlen;
190
        return p;
191
    } else {
192
        return iommu_dma_memory_map(dma, addr, len, dir);
193
    }
194
}
195

  
196
void iommu_dma_memory_unmap(DMAContext *dma,
197
                            void *buffer, dma_addr_t len,
198
                            DMADirection dir, dma_addr_t access_len);
199
static inline void dma_memory_unmap(DMAContext *dma,
200
                                    void *buffer, dma_addr_t len,
201
                                    DMADirection dir, dma_addr_t access_len)
202
{
203
    if (!dma_has_iommu(dma)) {
204
        address_space_unmap(dma->as, buffer, (hwaddr)len,
205
                            dir == DMA_DIRECTION_FROM_DEVICE, access_len);
206
    } else {
207
        iommu_dma_memory_unmap(dma, buffer, len, dir, access_len);
208
    }
209
}
210

  
211
#define DEFINE_LDST_DMA(_lname, _sname, _bits, _end) \
212
    static inline uint##_bits##_t ld##_lname##_##_end##_dma(DMAContext *dma, \
213
                                                            dma_addr_t addr) \
214
    {                                                                   \
215
        uint##_bits##_t val;                                            \
216
        dma_memory_read(dma, addr, &val, (_bits) / 8);                  \
217
        return _end##_bits##_to_cpu(val);                               \
218
    }                                                                   \
219
    static inline void st##_sname##_##_end##_dma(DMAContext *dma,       \
220
                                                 dma_addr_t addr,       \
221
                                                 uint##_bits##_t val)   \
222
    {                                                                   \
223
        val = cpu_to_##_end##_bits(val);                                \
224
        dma_memory_write(dma, addr, &val, (_bits) / 8);                 \
225
    }
226

  
227
static inline uint8_t ldub_dma(DMAContext *dma, dma_addr_t addr)
228
{
229
    uint8_t val;
230

  
231
    dma_memory_read(dma, addr, &val, 1);
232
    return val;
233
}
234

  
235
static inline void stb_dma(DMAContext *dma, dma_addr_t addr, uint8_t val)
236
{
237
    dma_memory_write(dma, addr, &val, 1);
238
}
239

  
240
DEFINE_LDST_DMA(uw, w, 16, le);
241
DEFINE_LDST_DMA(l, l, 32, le);
242
DEFINE_LDST_DMA(q, q, 64, le);
243
DEFINE_LDST_DMA(uw, w, 16, be);
244
DEFINE_LDST_DMA(l, l, 32, be);
245
DEFINE_LDST_DMA(q, q, 64, be);
246

  
247
#undef DEFINE_LDST_DMA
248

  
249
void dma_context_init(DMAContext *dma, AddressSpace *as, DMATranslateFunc translate,
250
                      DMAMapFunc map, DMAUnmapFunc unmap);
251

  
252
struct ScatterGatherEntry {
253
    dma_addr_t base;
254
    dma_addr_t len;
255
};
256

  
257
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint, DMAContext *dma);
258
void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len);
259
void qemu_sglist_destroy(QEMUSGList *qsg);
260
#endif
261

  
262
typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num,
263
                                 QEMUIOVector *iov, int nb_sectors,
264
                                 BlockDriverCompletionFunc *cb, void *opaque);
265

  
266
BlockDriverAIOCB *dma_bdrv_io(BlockDriverState *bs,
267
                              QEMUSGList *sg, uint64_t sector_num,
268
                              DMAIOFunc *io_func, BlockDriverCompletionFunc *cb,
269
                              void *opaque, DMADirection dir);
270
BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
271
                                QEMUSGList *sg, uint64_t sector,
272
                                BlockDriverCompletionFunc *cb, void *opaque);
273
BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
274
                                 QEMUSGList *sg, uint64_t sector,
275
                                 BlockDriverCompletionFunc *cb, void *opaque);
276
uint64_t dma_buf_read(uint8_t *ptr, int32_t len, QEMUSGList *sg);
277
uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg);
278

  
279
void dma_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie,
280
                    QEMUSGList *sg, enum BlockAcctType type);
281

  
282
#endif
b/dump-stub.c
12 12
 */
13 13

  
14 14
#include "qemu-common.h"
15
#include "dump.h"
15
#include "sysemu/dump.h"
16 16
#include "qapi/qmp/qerror.h"
17 17
#include "qmp-commands.h"
18 18

  
b/dump.c
17 17
#include "exec/cpu-all.h"
18 18
#include "exec/hwaddr.h"
19 19
#include "monitor/monitor.h"
20
#include "kvm.h"
21
#include "dump.h"
22
#include "sysemu.h"
23
#include "memory_mapping.h"
20
#include "sysemu/kvm.h"
21
#include "sysemu/dump.h"
22
#include "sysemu/sysemu.h"
23
#include "sysemu/memory_mapping.h"
24 24
#include "qapi/error.h"
25 25
#include "qmp-commands.h"
26 26
#include "exec/gdbstub.h"
/dev/null
1
/*
2
 * QEMU dump
3
 *
4
 * Copyright Fujitsu, Corp. 2011, 2012
5
 *
6
 * Authors:
7
 *     Wen Congyang <wency@cn.fujitsu.com>
8
 *
9
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10
 * See the COPYING file in the top-level directory.
11
 *
12
 */
13

  
14
#ifndef DUMP_H
15
#define DUMP_H
16

  
17
typedef struct ArchDumpInfo {
18
    int d_machine;  /* Architecture */
19
    int d_endian;   /* ELFDATA2LSB or ELFDATA2MSB */
20
    int d_class;    /* ELFCLASS32 or ELFCLASS64 */
21
} ArchDumpInfo;
22

  
23
typedef int (*write_core_dump_function)(void *buf, size_t size, void *opaque);
24
int cpu_write_elf64_note(write_core_dump_function f, CPUArchState *env,
25
                                                  int cpuid, void *opaque);
26
int cpu_write_elf32_note(write_core_dump_function f, CPUArchState *env,
27
                                                  int cpuid, void *opaque);
28
int cpu_write_elf64_qemunote(write_core_dump_function f, CPUArchState *env,
29
                                                          void *opaque);
30
int cpu_write_elf32_qemunote(write_core_dump_function f, CPUArchState *env,
31
                                                          void *opaque);
32
int cpu_get_dump_info(ArchDumpInfo *info);
33
ssize_t cpu_get_note_size(int class, int machine, int nr_cpus);
34

  
35
#endif
b/exec.c
30 30
#include "hw/hw.h"
31 31
#include "hw/qdev.h"
32 32
#include "qemu/osdep.h"
33
#include "kvm.h"
33
#include "sysemu/kvm.h"
34 34
#include "hw/xen.h"
35 35
#include "qemu/timer.h"
36 36
#include "qemu/config-file.h"
37 37
#include "exec/memory.h"
38
#include "dma.h"
38
#include "sysemu/dma.h"
39 39
#include "exec/address-spaces.h"
40 40
#if defined(CONFIG_USER_ONLY)
41 41
#include <qemu.h>
42 42
#else /* !CONFIG_USER_ONLY */
43
#include "xen-mapcache.h"
43
#include "sysemu/xen-mapcache.h"
44 44
#include "trace.h"
45 45
#endif
46 46

  
b/gdbstub.c
31 31
#else
32 32
#include "monitor/monitor.h"
33 33
#include "qemu-char.h"
34
#include "sysemu.h"
34
#include "sysemu/sysemu.h"
35 35
#include "exec/gdbstub.h"
36 36
#endif
37 37

  
......
39 39

  
40 40
#include "cpu.h"
41 41
#include "qemu/sockets.h"
42
#include "kvm.h"
42
#include "sysemu/kvm.h"
43 43

  
44 44
#ifndef TARGET_CPU_MEMORY_RW_DEBUG
45 45
static inline int target_memory_rw_debug(CPUArchState *env, target_ulong addr,
b/hw/ac97.c
21 21
#include "audiodev.h"
22 22
#include "audio/audio.h"
23 23
#include "pci/pci.h"
24
#include "dma.h"
24
#include "sysemu/dma.h"
25 25

  
26 26
enum {
27 27
    AC97_Reset                     = 0x00,
b/hw/acpi.c
18 18
 * Contributions after 2012-01-13 are licensed under the terms of the
19 19
 * GNU GPL, version 2 or (at your option) any later version.
20 20
 */
21
#include "sysemu.h"
21
#include "sysemu/sysemu.h"
22 22
#include "hw.h"
23 23
#include "pc.h"
24 24
#include "acpi.h"
b/hw/acpi_ich9.c
27 27
#include "pc.h"
28 28
#include "pci/pci.h"
29 29
#include "qemu/timer.h"
30
#include "sysemu.h"
30
#include "sysemu/sysemu.h"
31 31
#include "acpi.h"
32
#include "kvm.h"
32
#include "sysemu/kvm.h"
33 33
#include "exec/address-spaces.h"
34 34

  
35 35
#include "ich9.h"
b/hw/acpi_piix4.c
24 24
#include "pm_smbus.h"
25 25
#include "pci/pci.h"
26 26
#include "acpi.h"
27
#include "sysemu.h"
27
#include "sysemu/sysemu.h"
28 28
#include "qemu/range.h"
29 29
#include "exec/ioport.h"
30 30
#include "fw_cfg.h"
b/hw/alpha_dp264.c
11 11
#include "loader.h"
12 12
#include "boards.h"
13 13
#include "alpha_sys.h"
14
#include "sysemu.h"
14
#include "sysemu/sysemu.h"
15 15
#include "mc146818rtc.h"
16 16
#include "ide.h"
17 17
#include "i8254.h"
b/hw/alpha_pci.c
9 9
#include "config.h"
10 10
#include "alpha_sys.h"
11 11
#include "qemu/log.h"
12
#include "sysemu.h"
12
#include "sysemu/sysemu.h"
13 13

  
14 14

  
15 15
/* PCI IO reads/writes, to byte-word addressable memory.  */
b/hw/alpha_typhoon.c
10 10
#include "exec/exec-all.h"
11 11
#include "hw.h"
12 12
#include "devices.h"
13
#include "sysemu.h"
13
#include "sysemu/sysemu.h"
14 14
#include "alpha_sys.h"
15 15
#include "exec/address-spaces.h"
16 16

  
b/hw/apb_pci.c
32 32
#include "pci/pci_bridge.h"
33 33
#include "pci/pci_bus.h"
34 34
#include "apb_pci.h"
35
#include "sysemu.h"
35
#include "sysemu/sysemu.h"
36 36
#include "exec/address-spaces.h"
37 37

  
38 38
/* debug APB */
b/hw/apic_common.c
20 20
#include "apic.h"
21 21
#include "apic_internal.h"
22 22
#include "trace.h"
23
#include "kvm.h"
23
#include "sysemu/kvm.h"
24 24

  
25 25
static int apic_irq_delivered;
26 26
bool apic_report_tpr_access;
b/hw/arm_boot.c
10 10
#include "config.h"
11 11
#include "hw.h"
12 12
#include "arm-misc.h"
13
#include "sysemu.h"
13
#include "sysemu/sysemu.h"
14 14
#include "boards.h"
15 15
#include "loader.h"
16 16
#include "elf.h"
17
#include "device_tree.h"
17
#include "sysemu/device_tree.h"
18 18
#include "qemu/config-file.h"
19 19

  
20 20
#define KERNEL_ARGS_ADDR 0x100
b/hw/arm_sysctl.c
11 11
#include "qemu/timer.h"
12 12
#include "sysbus.h"
13 13
#include "primecell.h"
14
#include "sysemu.h"
14
#include "sysemu/sysemu.h"
15 15

  
16 16
#define LOCK_VALUE 0xa05f
17 17

  
b/hw/axis_dev88.c
30 30
#include "loader.h"
31 31
#include "elf.h"
32 32
#include "cris-boot.h"
33
#include "blockdev.h"
33
#include "sysemu/blockdev.h"
34 34
#include "exec/address-spaces.h"
35 35

  
36 36
#define D(x)
b/hw/block-common.c
7 7
 * later.  See the COPYING file in the top-level directory.
8 8
 */
9 9

  
10
#include "blockdev.h"
10
#include "sysemu/blockdev.h"
11 11
#include "hw/block-common.h"
12 12
#include "qemu/error-report.h"
13 13

  
b/hw/boards.h
3 3
#ifndef HW_BOARDS_H
4 4
#define HW_BOARDS_H
5 5

  
6
#include "blockdev.h"
6
#include "sysemu/blockdev.h"
7 7
#include "qdev.h"
8 8

  
9 9
typedef struct QEMUMachineInitArgs {
b/hw/bonito.c
44 44
#include "pc.h"
45 45
#include "mips.h"
46 46
#include "pci/pci_host.h"
47
#include "sysemu.h"
47
#include "sysemu/sysemu.h"
48 48
#include "exec/address-spaces.h"
49 49

  
50 50
//#define DEBUG_BONITO
b/hw/cbus.c
23 23
#include "qemu-common.h"
24 24
#include "irq.h"
25 25
#include "devices.h"
26
#include "sysemu.h"
26
#include "sysemu/sysemu.h"
27 27

  
28 28
//#define DEBUG
29 29

  
b/hw/collie.c
15 15
#include "strongarm.h"
16 16
#include "arm-misc.h"
17 17
#include "flash.h"
18
#include "blockdev.h"
18
#include "sysemu/blockdev.h"
19 19
#include "exec/address-spaces.h"
20 20

  
21 21
static struct arm_boot_info collie_binfo = {
b/hw/cuda.c
26 26
#include "ppc_mac.h"
27 27
#include "adb.h"
28 28
#include "qemu/timer.h"
29
#include "sysemu.h"
29
#include "sysemu/sysemu.h"
30 30

  
31 31
/* XXX: implement all timer modes */
32 32

  
b/hw/device-hotplug.c
24 24

  
25 25
#include "hw.h"
26 26
#include "boards.h"
27
#include "blockdev.h"
27
#include "sysemu/blockdev.h"
28 28
#include "qemu/config-file.h"
29
#include "sysemu.h"
29
#include "sysemu/sysemu.h"
30 30
#include "monitor/monitor.h"
31 31

  
32 32
DriveInfo *add_init_drive(const char *optstr)
b/hw/e1000.c
30 30
#include "net/net.h"
31 31
#include "net/checksum.h"
32 32
#include "loader.h"
33
#include "sysemu.h"
34
#include "dma.h"
33
#include "sysemu/sysemu.h"
34
#include "sysemu/dma.h"
35 35

  
36 36
#include "e1000_hw.h"
37 37

  
b/hw/eepro100.c
45 45
#include "pci/pci.h"
46 46
#include "net/net.h"
47 47
#include "eeprom93xx.h"
48
#include "sysemu.h"
49
#include "dma.h"
48
#include "sysemu/sysemu.h"
49
#include "sysemu/dma.h"
50 50

  
51 51
/* QEMU sends frames smaller than 60 bytes to ethernet nics.
52 52
 * Such frames are rejected by real nics and their emulations.
b/hw/es1370.c
30 30
#include "audiodev.h"
31 31
#include "audio/audio.h"
32 32
#include "pci/pci.h"
33
#include "dma.h"
33
#include "sysemu/dma.h"
34 34

  
35 35
/* Missing stuff:
36 36
   SCTRL_P[12](END|ST)INC
b/hw/etraxfs_dma.c
26 26
#include "hw.h"
27 27
#include "exec/address-spaces.h"
28 28
#include "qemu-common.h"
29
#include "sysemu.h"
29
#include "sysemu/sysemu.h"
30 30

  
31 31
#include "etraxfs_dma.h"
32 32

  
b/hw/etraxfs_timer.c
22 22
 * THE SOFTWARE.
23 23
 */
24 24
#include "sysbus.h"
25
#include "sysemu.h"
25
#include "sysemu/sysemu.h"
26 26
#include "qemu/timer.h"
27 27
#include "ptimer.h"
28 28

  
b/hw/exynos4210.c
22 22
 */
23 23

  
24 24
#include "boards.h"
25
#include "sysemu.h"
25
#include "sysemu/sysemu.h"
26 26
#include "sysbus.h"
27 27
#include "arm-misc.h"
28 28
#include "loader.h"
b/hw/exynos4210_rtc.c
32 32

  
33 33
#include "hw.h"
34 34
#include "qemu/timer.h"
35
#include "sysemu.h"
35
#include "sysemu/sysemu.h"
36 36

  
37 37
#include "exynos4210.h"
38 38

  
b/hw/exynos4210_uart.c
20 20
 */
21 21

  
22 22
#include "sysbus.h"
23
#include "sysemu.h"
23
#include "sysemu/sysemu.h"
24 24
#include "qemu-char.h"
25 25

  
26 26
#include "exynos4210.h"
b/hw/exynos4_boards.c
21 21
 *
22 22
 */
23 23

  
24
#include "sysemu.h"
24
#include "sysemu/sysemu.h"
25 25
#include "sysbus.h"
26 26
#include "net/net.h"
27 27
#include "arm-misc.h"
b/hw/fdc.c
34 34
#include "isa.h"
35 35
#include "sysbus.h"
36 36
#include "qdev-addr.h"
37
#include "blockdev.h"
38
#include "sysemu.h"
37
#include "sysemu/blockdev.h"
38
#include "sysemu/sysemu.h"
39 39
#include "qemu/log.h"
40 40

  
41 41
/********************************************************/
b/hw/fw_cfg.c
22 22
 * THE SOFTWARE.
23 23
 */
24 24
#include "hw.h"
25
#include "sysemu.h"
25
#include "sysemu/sysemu.h"
26 26
#include "isa.h"
27 27
#include "fw_cfg.h"
28 28
#include "sysbus.h"
b/hw/gumstix.c
40 40
#include "flash.h"
41 41
#include "devices.h"
42 42
#include "boards.h"
43
#include "blockdev.h"
43
#include "sysemu/blockdev.h"
44 44
#include "exec/address-spaces.h"
45 45

  
46 46
static const int sector_len = 128 * 1024;
b/hw/highbank.c
22 22
#include "devices.h"
23 23
#include "loader.h"
24 24
#include "net/net.h"
25
#include "sysemu.h"
25
#include "sysemu/sysemu.h"
26 26
#include "boards.h"
27 27
#include "sysbus.h"
28
#include "blockdev.h"
28
#include "sysemu/blockdev.h"
29 29
#include "exec/address-spaces.h"
30 30

  
31 31
#define SMP_BOOT_ADDR 0x100
b/hw/ide/ahci.c
28 28
#include <hw/sysbus.h>
29 29

  
30 30
#include "monitor/monitor.h"
31
#include "dma.h"
31
#include "sysemu/dma.h"
32 32
#include "exec/cpu-common.h"
33 33
#include "internal.h"
34 34
#include <hw/ide/pci.h>
b/hw/ide/cmd646.c
27 27
#include <hw/pci/pci.h>
28 28
#include <hw/isa.h>
29 29
#include "block/block.h"
30
#include "sysemu.h"
31
#include "dma.h"
30
#include "sysemu/sysemu.h"
31
#include "sysemu/dma.h"
32 32

  
33 33
#include <hw/ide/pci.h>
34 34

  
b/hw/ide/core.c
28 28
#include <hw/isa.h>
29 29
#include "qemu/error-report.h"
30 30
#include "qemu/timer.h"
31
#include "sysemu.h"
32
#include "dma.h"
31
#include "sysemu/sysemu.h"
32
#include "sysemu/dma.h"
33 33
#include "hw/block-common.h"
34
#include "blockdev.h"
34
#include "sysemu/blockdev.h"
35 35

  
36 36
#include <hw/ide/internal.h>
37 37

  
b/hw/ide/ich.c
66 66
#include <hw/pci/pci.h>
67 67
#include <hw/isa.h>
68 68
#include "block/block.h"
69
#include "dma.h"
69
#include "sysemu/dma.h"
70 70

  
71 71
#include <hw/ide/pci.h>
72 72
#include <hw/ide/ahci.h>
b/hw/ide/internal.h
9 9
#include <hw/ide.h>
10 10
#include <hw/isa.h>
11 11
#include "exec/iorange.h"
12
#include "dma.h"
13
#include "sysemu.h"
12
#include "sysemu/dma.h"
13
#include "sysemu/sysemu.h"
14 14
#include "hw/block-common.h"
15 15
#include "hw/scsi-defs.h"
16 16

  
b/hw/ide/isa.c
26 26
#include <hw/pc.h>
27 27
#include <hw/isa.h>
28 28
#include "block/block.h"
29
#include "dma.h"
29
#include "sysemu/dma.h"
30 30

  
31 31
#include <hw/ide/internal.h>
32 32

  
b/hw/ide/macio.c
26 26
#include <hw/ppc_mac.h>
27 27
#include <hw/mac_dbdma.h>
28 28
#include "block/block.h"
29
#include "dma.h"
29
#include "sysemu/dma.h"
30 30

  
31 31
#include <hw/ide/internal.h>
32 32

  
b/hw/ide/microdrive.c
26 26
#include <hw/pc.h>
27 27
#include <hw/pcmcia.h>
28 28
#include "block/block.h"
29
#include "dma.h"
29
#include "sysemu/dma.h"
30 30

  
31 31
#include <hw/ide/internal.h>
32 32

  
b/hw/ide/mmio.c
24 24
 */
25 25
#include <hw/hw.h>
26 26
#include "block/block.h"
27
#include "dma.h"
27
#include "sysemu/dma.h"
28 28

  
29 29
#include <hw/ide/internal.h>
30 30

  
b/hw/ide/pci.c
27 27
#include <hw/pci/pci.h>
28 28
#include <hw/isa.h>
29 29
#include "block/block.h"
30
#include "dma.h"
30
#include "sysemu/dma.h"
31 31

  
32 32
#include <hw/ide/pci.h>
33 33

  
b/hw/ide/piix.c
27 27
#include <hw/pc.h>
28 28
#include <hw/pci/pci.h>
29 29
#include <hw/isa.h>
30
#include "blockdev.h"
31
#include "sysemu.h"
32
#include "dma.h"
30
#include "sysemu/blockdev.h"
31
#include "sysemu/sysemu.h"
32
#include "sysemu/dma.h"
33 33

  
34 34
#include <hw/ide/pci.h>
35 35

  
b/hw/ide/qdev.c
17 17
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 18
 */
19 19
#include <hw/hw.h>
20
#include "dma.h"
20
#include "sysemu/dma.h"
21 21
#include "qemu/error-report.h"
22 22
#include <hw/ide/internal.h>
23
#include "blockdev.h"
23
#include "sysemu/blockdev.h"
24 24
#include "hw/block-common.h"
25
#include "sysemu.h"
25
#include "sysemu/sysemu.h"
26 26

  
27 27
/* --------------------------------- */
28 28

  
b/hw/ide/via.c
28 28
#include <hw/pci/pci.h>
29 29
#include <hw/isa.h>
30 30
#include "block/block.h"
31
#include "sysemu.h"
32
#include "dma.h"
31
#include "sysemu/sysemu.h"
32
#include "sysemu/dma.h"
33 33

  
34 34
#include <hw/ide/pci.h>
35 35

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff