2007-11-17 20:14:51 +03:00
|
|
|
/* Declarations for use by hardware emulation. */
|
|
|
|
#ifndef QEMU_HW_H
|
|
|
|
#define QEMU_HW_H
|
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2009-05-19 19:17:58 +04:00
|
|
|
|
2012-10-04 14:36:04 +04:00
|
|
|
#if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/cpu-common.h"
|
2009-05-19 19:17:58 +04:00
|
|
|
#endif
|
|
|
|
|
2012-12-17 21:19:49 +04:00
|
|
|
#include "exec/ioport.h"
|
2013-02-04 18:40:22 +04:00
|
|
|
#include "hw/irq.h"
|
2012-12-17 21:19:44 +04:00
|
|
|
#include "block/aio.h"
|
2012-12-17 21:19:50 +04:00
|
|
|
#include "migration/vmstate.h"
|
2012-12-17 21:20:00 +04:00
|
|
|
#include "qemu/log.h"
|
2008-10-02 23:14:17 +04:00
|
|
|
|
2007-11-17 20:14:51 +03: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 23:14:17 +04: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 20:14:51 +03: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 23:14:17 +04: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 20:14:51 +03:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef void QEMUResetHandler(void *opaque);
|
|
|
|
|
2009-06-27 11:25:07 +04:00
|
|
|
void qemu_register_reset(QEMUResetHandler *func, void *opaque);
|
2009-07-02 02:19:02 +04:00
|
|
|
void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2009-07-02 02:19:02 +04:00
|
|
|
/* handler to set the boot_device order for a specific type of QEMUMachine */
|
2008-05-05 00:11:34 +04:00
|
|
|
/* return 0 if success */
|
2013-06-14 15:15:04 +04:00
|
|
|
typedef int QEMUBootSetHandler(void *opaque, const char *boot_order);
|
2008-06-20 20:25:06 +04:00
|
|
|
void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque);
|
2013-06-14 15:15:04 +04:00
|
|
|
int qemu_boot_set(const char *boot_order);
|
2008-05-05 00:11:34 +04:00
|
|
|
|
2009-09-30 00:49:00 +04:00
|
|
|
#ifdef NEED_CPU_H
|
|
|
|
#if TARGET_LONG_BITS == 64
|
|
|
|
#define VMSTATE_UINTTL_V(_f, _s, _v) \
|
|
|
|
VMSTATE_UINT64_V(_f, _s, _v)
|
2013-03-12 07:06:01 +04:00
|
|
|
#define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v) \
|
|
|
|
VMSTATE_UINT64_EQUAL_V(_f, _s, _v)
|
2009-09-30 00:49:00 +04:00
|
|
|
#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)
|
2013-03-12 07:06:01 +04:00
|
|
|
#define VMSTATE_UINTTL_EQUAL_V(_f, _s, _v) \
|
|
|
|
VMSTATE_UINT32_EQUAL_V(_f, _s, _v)
|
2009-09-30 00:49:00 +04:00
|
|
|
#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)
|
2013-03-12 07:06:01 +04:00
|
|
|
#define VMSTATE_UINTTL_EQUAL(_f, _s) \
|
|
|
|
VMSTATE_UINTTL_EQUAL_V(_f, _s, 0)
|
2009-09-30 00:49:00 +04:00
|
|
|
#define VMSTATE_UINTTL_ARRAY(_f, _s, _n) \
|
|
|
|
VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
#endif
|