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