2007-11-17 17:14:51 +00:00
|
|
|
/* Declarations for use by hardware emulation. */
|
|
|
|
#ifndef QEMU_HW_H
|
|
|
|
#define QEMU_HW_H
|
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2009-05-19 15:17:58 +00:00
|
|
|
|
2012-10-04 10:36:04 +00:00
|
|
|
#if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
|
2012-12-17 17:19:49 +00:00
|
|
|
#include "exec/cpu-common.h"
|
2009-05-19 15:17:58 +00:00
|
|
|
#endif
|
|
|
|
|
2012-12-17 17:19:49 +00:00
|
|
|
#include "exec/ioport.h"
|
2013-02-04 14:40:22 +00:00
|
|
|
#include "hw/irq.h"
|
2012-12-17 17:19:44 +00:00
|
|
|
#include "block/aio.h"
|
2012-12-17 17:19:50 +00:00
|
|
|
#include "migration/qemu-file.h"
|
|
|
|
#include "migration/vmstate.h"
|
2012-12-17 17:20:00 +00:00
|
|
|
#include "qemu/log.h"
|
2008-10-02 19:14:17 +00:00
|
|
|
|
2007-11-17 17:14:51 +00:00
|
|
|
#ifdef NEED_CPU_H
|
|
|
|
#if TARGET_LONG_BITS == 64
|
|
|
|
#define qemu_put_betl qemu_put_be64
|
|
|
|
#define qemu_get_betl qemu_get_be64
|
|
|
|
#define qemu_put_betls qemu_put_be64s
|
|
|
|
#define qemu_get_betls qemu_get_be64s
|
2008-10-02 19:14:17 +00:00
|
|
|
#define qemu_put_sbetl qemu_put_sbe64
|
|
|
|
#define qemu_get_sbetl qemu_get_sbe64
|
|
|
|
#define qemu_put_sbetls qemu_put_sbe64s
|
|
|
|
#define qemu_get_sbetls qemu_get_sbe64s
|
2007-11-17 17:14:51 +00:00
|
|
|
#else
|
|
|
|
#define qemu_put_betl qemu_put_be32
|
|
|
|
#define qemu_get_betl qemu_get_be32
|
|
|
|
#define qemu_put_betls qemu_put_be32s
|
|
|
|
#define qemu_get_betls qemu_get_be32s
|
2008-10-02 19:14:17 +00:00
|
|
|
#define qemu_put_sbetl qemu_put_sbe32
|
|
|
|
#define qemu_get_sbetl qemu_get_sbe32
|
|
|
|
#define qemu_put_sbetls qemu_put_sbe32s
|
|
|
|
#define qemu_get_sbetls qemu_get_sbe32s
|
2007-11-17 17:14:51 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef void QEMUResetHandler(void *opaque);
|
|
|
|
|
2009-06-27 07:25:07 +00:00
|
|
|
void qemu_register_reset(QEMUResetHandler *func, void *opaque);
|
2009-07-01 22:19:02 +00:00
|
|
|
void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
|
2007-11-17 17:14:51 +00:00
|
|
|
|
2009-07-01 22:19:02 +00:00
|
|
|
/* handler to set the boot_device order for a specific type of QEMUMachine */
|
2008-05-04 20:11:34 +00:00
|
|
|
/* return 0 if success */
|
2009-07-01 22:19:02 +00:00
|
|
|
typedef int QEMUBootSetHandler(void *opaque, const char *boot_devices);
|
2008-06-20 16:25:06 +00:00
|
|
|
void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque);
|
2009-07-01 22:19:02 +00:00
|
|
|
int qemu_boot_set(const char *boot_devices);
|
2008-05-04 20:11:34 +00:00
|
|
|
|
2009-09-29 20:49:00 +00:00
|
|
|
#ifdef NEED_CPU_H
|
|
|
|
#if TARGET_LONG_BITS == 64
|
|
|
|
#define VMSTATE_UINTTL_V(_f, _s, _v) \
|
|
|
|
VMSTATE_UINT64_V(_f, _s, _v)
|
|
|
|
#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \
|
|
|
|
VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v)
|
|
|
|
#else
|
|
|
|
#define VMSTATE_UINTTL_V(_f, _s, _v) \
|
|
|
|
VMSTATE_UINT32_V(_f, _s, _v)
|
|
|
|
#define VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, _v) \
|
|
|
|
VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v)
|
|
|
|
#endif
|
|
|
|
#define VMSTATE_UINTTL(_f, _s) \
|
|
|
|
VMSTATE_UINTTL_V(_f, _s, 0)
|
|
|
|
#define VMSTATE_UINTTL_ARRAY(_f, _s, _n) \
|
|
|
|
VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-11-17 17:14:51 +00:00
|
|
|
#endif
|