Merge branch 's390-reorg' of git://repo.or.cz/qemu/rth
[qemu/agraf.git] / hw / hw.h
blobdfced97bbc1ce605cd5b2b6b8e1b0e272e879b21
1 /* Declarations for use by hardware emulation. */
2 #ifndef QEMU_HW_H
3 #define QEMU_HW_H
5 #include "qemu-common.h"
7 #if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
8 #include "exec/cpu-common.h"
9 #endif
11 #include "exec/ioport.h"
12 #include "irq.h"
13 #include "block/aio.h"
14 #include "migration/qemu-file.h"
15 #include "migration/vmstate.h"
16 #include "qemu/log.h"
18 #ifdef NEED_CPU_H
19 #if TARGET_LONG_BITS == 64
20 #define qemu_put_betl qemu_put_be64
21 #define qemu_get_betl qemu_get_be64
22 #define qemu_put_betls qemu_put_be64s
23 #define qemu_get_betls qemu_get_be64s
24 #define qemu_put_sbetl qemu_put_sbe64
25 #define qemu_get_sbetl qemu_get_sbe64
26 #define qemu_put_sbetls qemu_put_sbe64s
27 #define qemu_get_sbetls qemu_get_sbe64s
28 #else
29 #define qemu_put_betl qemu_put_be32
30 #define qemu_get_betl qemu_get_be32
31 #define qemu_put_betls qemu_put_be32s
32 #define qemu_get_betls qemu_get_be32s
33 #define qemu_put_sbetl qemu_put_sbe32
34 #define qemu_get_sbetl qemu_get_sbe32
35 #define qemu_put_sbetls qemu_put_sbe32s
36 #define qemu_get_sbetls qemu_get_sbe32s
37 #endif
38 #endif
40 typedef void QEMUResetHandler(void *opaque);
42 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
43 void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
45 /* handler to set the boot_device order for a specific type of QEMUMachine */
46 /* return 0 if success */
47 typedef int QEMUBootSetHandler(void *opaque, const char *boot_devices);
48 void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque);
49 int qemu_boot_set(const char *boot_devices);
51 #ifdef NEED_CPU_H
52 #if TARGET_LONG_BITS == 64
53 #define VMSTATE_UINTTL_V(_f, _s, _v) \
54 VMSTATE_UINT64_V(_f, _s, _v)
55 #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \
56 VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)
57 #else
58 #define VMSTATE_UINTTL_V(_f, _s, _v) \
59 VMSTATE_UINT32_V(_f, _s, _v)
60 #define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \
61 VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)
62 #endif
63 #define VMSTATE_UINTTL(_f, _s) \
64 VMSTATE_UINTTL_V(_f, _s, 0)
65 #define VMSTATE_UINTTL_ARRAY(_f, _s, _n) \
66 VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
68 #endif
70 #endif