#include "sysemu/hw_accel.h"
#include "hw/qdev.h"
-//#define VMPORT_DEBUG
+/* #define VMPORT_DEBUG */
#define VMPORT_CMD_GETVERSION 0x0a
#define VMPORT_CMD_GETRAMSIZE 0x14
#define VMPORT(obj) OBJECT_CHECK(VMPortState, (obj), TYPE_VMPORT)
-typedef struct VMPortState
-{
+typedef struct VMPortState {
ISADevice parent_obj;
MemoryRegion io;
void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque)
{
- if (command >= VMPORT_ENTRIES)
+ if (command >= VMPORT_ENTRIES) {
return;
+ }
port_state->func[command] = func;
port_state->opaque[command] = opaque;
cpu_synchronize_state(cs);
eax = env->regs[R_EAX];
- if (eax != VMPORT_MAGIC)
+ if (eax != VMPORT_MAGIC) {
return eax;
+ }
command = env->regs[R_ECX];
- if (command >= VMPORT_ENTRIES)
+ if (command >= VMPORT_ENTRIES) {
return eax;
- if (!s->func[command])
- {
+ }
+ if (!s->func[command]) {
#ifdef VMPORT_DEBUG
fprintf(stderr, "vmport: unknown command %x\n", command);
#endif
common-obj-y += unimp.o
common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o
-obj-$(CONFIG_VMPORT) += vmport.o
-
# ARM devices
common-obj-$(CONFIG_PL310) += arm_l2x0.o
common-obj-$(CONFIG_INTEGRATOR_DEBUG) += arm_integrator_debug.o