static void goldfish_bus_write(void *opaque, target_phys_addr_t offset, uint32_t value) { struct bus_state *s = (struct bus_state *)opaque; switch(offset) { case PDEV_BUS_OP: switch(value) { case PDEV_BUS_OP_INIT: goldfish_bus_op_init(s); break; default: cpu_abort (cpu_single_env, "goldfish_bus_write: Bad PDEV_BUS_OP value %x\n", value); }; break; case PDEV_BUS_GET_NAME: if(s->current) { #ifdef TARGET_I386 if(kvm_enabled()) cpu_synchronize_state(cpu_single_env, 0); #endif cpu_memory_rw_debug(cpu_single_env, value, (void*)s->current->name, strlen(s->current->name), 1); } break; default: cpu_abort (cpu_single_env, "goldfish_bus_write: Bad offset %x\n", offset); } }
static void goldfish_bus_write(void *opaque, hwaddr offset, uint32_t value) { struct bus_state *s = (struct bus_state *)opaque; switch(offset) { case PDEV_BUS_OP: switch(value) { case PDEV_BUS_OP_INIT: goldfish_bus_op_init(s); break; default: cpu_abort(cpu_single_env, "goldfish_bus_write: Bad PDEV_BUS_OP value %x\n", value); }; break; case PDEV_BUS_GET_NAME: if(s->current) { target_ulong name = (target_ulong)(s->name_addr_high | value); safe_memory_rw_debug(current_cpu, name, (void*)s->current->name, strlen(s->current->name), 1); } break; case PDEV_BUS_NAME_ADDR_HIGH: s->name_addr_high = ((uint64_t)value << 32); goldfish_64bit_guest = 1; break; default: cpu_abort(cpu_single_env, "goldfish_bus_write: Bad offset %" HWADDR_PRIx "\n", offset); } }